From bb3a67cc4a8a49ebf6f8e4faf7b74944e11f01f9 Mon Sep 17 00:00:00 2001 From: Dmitrii Vasilev Date: Sun, 9 Aug 2026 00:50:30 +0700 Subject: [PATCH 1/5] feat(numeric): register the GF-T ladder in the catalog SSOT, all nine rungs GF-T was absent from specs/numeric/formats_catalog.t27 entirely. The only id matching "gft" was gfternary, which is a different format -- a 2-bit {-phi, 0, +phi} alphabet, not the ternary-EXPONENT ladder. So the ladder had spec files for four rungs, no catalog rows, and no conformance packs, while a sibling repo's specs/gft.tri named this directory as its own source of truth. The rows and the five missing rungs are added here, where they belong. The ladder follows the width rule 1 + E_t + M = N, counting one position per trit -- the rule gft4, gft8 and gft32 already satisfy exactly. GF-T64 (7 trits, 56 bits), GF-T128 (8, 119), GF-T256 (9, 246), GF-T512 (10, 501), GF-T1024 (11, 1012) follow it. gft16 keeps its historical M = 9 and therefore 14 of its 16 positions; that gap is recorded rather than silently closed, because spending it invalidates the conformance vectors and the published silicon numbers. Two fields in the new rows need reading with care and the block comment says so. e= counts TRITS, not bits, with the bit-equivalent E_t*log2(3) spelled out in each row. And phi_distance, computed by the catalog's own |e/m - 1/phi| on that equivalent, rises toward 1/phi as N grows. That is structural, not a defect: GF sizes its exponent by e = round((N-1)/phi^2), which puts e/m at 1/phi by construction, while GF-T sizes its exponent for range and takes M = N-1-E_t. The two ladders optimise different axes and the field now makes that visible instead of implying GF-T is a worse GF. Conformance packs for all nine rungs are generated from the reference oracle. The probes are powers of two and 1.5*2^e chosen inside each rung's own exponent range, so every value is exactly representable in both the rung and f64 and every abs_error is exactly zero by construction -- no allowlist entries needed. An earlier attempt used fixed probes including 100.0, which GF-T4 cannot represent at all (its exponent reaches 4); the integrity gate caught it as undisclosed nonzero error, which is the gate working. Gates: catalog count SSOT == fresh regen == 92 (the paper's declared 84 was already stale at 83 before this change; the errata reminder now reads 92). WP-18 conformance integrity CLEAN. t27c typechecks all nine specs. Two of my own errors are worth recording. I first extended the derived zig-golden-float/specs/gft.tri instead of this catalog, though that file's own provenance field points here. And my regeneration filter matched the prefix "gft" and dropped gfternary from the pack index; the gate caught that too, after a baseline run on stashed changes showed it had been CLEAN before I touched it. Co-Authored-By: Claude Opus 5 --- conformance/vectors/INDEX_all_formats.json | 1576 +++++++++-------- .../vectors/gft1024_conformance_v0.json | 262 +++ .../vectors/gft128_conformance_v0.json | 262 +++ conformance/vectors/gft16_conformance_v0.json | 262 +++ .../vectors/gft256_conformance_v0.json | 262 +++ conformance/vectors/gft32_conformance_v0.json | 262 +++ conformance/vectors/gft4_conformance_v0.json | 196 ++ .../vectors/gft512_conformance_v0.json | 262 +++ conformance/vectors/gft64_conformance_v0.json | 262 +++ conformance/vectors/gft8_conformance_v0.json | 262 +++ specs/numeric/formats_catalog.t27 | 24 + specs/numeric/gft1024.t27 | 61 + specs/numeric/gft128.t27 | 61 + specs/numeric/gft256.t27 | 61 + specs/numeric/gft512.t27 | 61 + specs/numeric/gft64.t27 | 61 + 16 files changed, 3445 insertions(+), 752 deletions(-) create mode 100644 conformance/vectors/gft1024_conformance_v0.json create mode 100644 conformance/vectors/gft128_conformance_v0.json create mode 100644 conformance/vectors/gft16_conformance_v0.json create mode 100644 conformance/vectors/gft256_conformance_v0.json create mode 100644 conformance/vectors/gft32_conformance_v0.json create mode 100644 conformance/vectors/gft4_conformance_v0.json create mode 100644 conformance/vectors/gft512_conformance_v0.json create mode 100644 conformance/vectors/gft64_conformance_v0.json create mode 100644 conformance/vectors/gft8_conformance_v0.json create mode 100644 specs/numeric/gft1024.t27 create mode 100644 specs/numeric/gft128.t27 create mode 100644 specs/numeric/gft256.t27 create mode 100644 specs/numeric/gft512.t27 create mode 100644 specs/numeric/gft64.t27 diff --git a/conformance/vectors/INDEX_all_formats.json b/conformance/vectors/INDEX_all_formats.json index b93f5e9b3..0f6020ea0 100644 --- a/conformance/vectors/INDEX_all_formats.json +++ b/conformance/vectors/INDEX_all_formats.json @@ -1,753 +1,825 @@ { - "schema": "t27-conformance-index/v0.1", - "anchor_identity": "phi^2 + 1/phi^2 = 3", - "ssot": "https://github.com/gHashTag/t27/blob/master/conformance/FORMAT-SPEC-001.json", - "preprint": "https://arxiv.org/abs/2606.05017", - "total_formats": 83, - "total_packs": 83, - "bitexact_packs": 75, - "selfconsistent_packs": 0, - "structural_packs": 8, - "witnessed_packs": 10, - "packs": [ - { - "id": "binary16", - "file": "binary16_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "84fd7629430b06d761ac3b92fc85208c472a4582040b1ac2001cc87a6612f7b4", - "witnesses": 0 - }, - { - "id": "binary32", - "file": "binary32_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "9dc16a1c3b65b7f7a5d59c546886ed12e99fb37cbfc9f3d5d45813921e6a70ff", - "witnesses": 0 - }, - { - "id": "binary64", - "file": "binary64_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "1d3e3d6daee576ae3b2b4dca6f26560390535fb7441a54b389f98a4238e58bec", - "witnesses": 0 - }, - { - "id": "binary128", - "file": "binary128_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "9d08a8a6a10f94e875f73e5f44643f088435a570bfafaef9991464d5377b26e0", - "witnesses": 0 - }, - { - "id": "binary256", - "file": "binary256_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "43d39ae4c4808276ba1ed5b2d8c221c17983a53570da2fc161996b0f7ea3aee3", - "witnesses": 0 - }, - { - "id": "decimal32", - "file": "decimal32_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 7, - "source": "generated by gen_all_formats.py", - "sha256": "e13bc9cd6bc33545ab55f575e23d2343418ded5eddf1395b61f31321dc7d272e", - "witnesses": 0 - }, - { - "id": "decimal64", - "file": "decimal64_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 7, - "source": "generated by gen_all_formats.py", - "sha256": "fedef68cfe1b910e737574bbe331dc19fbe1724edbd35ec8beac89b1595bea0d", - "witnesses": 0 - }, - { - "id": "decimal128", - "file": "decimal128_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "84dbc594340717415385b3bd86eb20432f5430aba047557579f2e2a96de0dc2d", - "witnesses": 0 - }, - { - "id": "x87_fp80", - "file": "x87_fp80_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "e9be37c939c7108081bd2190e949f4d01be7ad12511d82bb8849f337c94e7e0c", - "witnesses": 0 - }, - { - "id": "double_double", - "file": "double_double_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "f8dc9608093afada65df94852a9b78c3a4a5466415389c5ec359afd19d3b208c", - "witnesses": 0 - }, - { - "id": "quad_double", - "file": "quad_double_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "62ef8067fd1d70ef0abac77d4b0252a3686b9cd698ee4806e0bc1e01bcfe7cfa", - "witnesses": 0 - }, - { - "id": "bfloat16", - "file": "bf16_golden_conformance_v0.json", - "kind": "bitexact", - "source": "hand-curated (pre-existing)", - "sha256": "98bbddcbb8a520dc45a6dfed7209c50a0acc0fabc4d3b430359969467eee4e13", - "witnesses": 0 - }, - { - "id": "tf32", - "file": "tf32_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "b35c334092b49dad9a944d37a91697f08f442b633142e81c69296c12bac0055d", - "witnesses": 0 - }, - { - "id": "fp8_e4m3", - "file": "fp8_e4m3fn_conformance_v0.json", - "kind": "bitexact", - "source": "hand-curated (pre-existing)", - "sha256": "7193ccd0d330d3e05154432abcec5da4a4c170e11004d4ffa44ff5cbbff9cba9", - "witnesses": 0 - }, - { - "id": "fp8_e5m2", - "file": "fp8_e5m2_conformance_v0.json", - "kind": "bitexact", - "source": "hand-curated (pre-existing)", - "sha256": "9c31fbd03923bd6555304848a092504dfbc02f72d2be82d2b80f49243e925a18", - "witnesses": 0 - }, - { - "id": "fp6_e3m2", - "file": "fp6_e3m2_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 64, - "source": "generated by gen_all_formats.py", - "sha256": "17a80f0a3b5b2495dbcd6de6062d8c1f8ce19b9746d1e370e6d16897ef5f9c02", - "witnesses": 0 - }, - { - "id": "fp6_e2m3", - "file": "fp6_e2m3_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 64, - "source": "generated by gen_all_formats.py", - "sha256": "de70d6aacf0ac2d47decae0866d14f126058176428315d4c767e460c0a9ae5e5", - "witnesses": 0 - }, - { - "id": "fp4_e2m1", - "file": "fp4_e2m1_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 16, - "source": "generated by gen_all_formats.py", - "sha256": "8ded6625c4644139320dd89b2b7815d6ba27177c35b7d645b2d93b8cfdc63fd9", - "witnesses": 0 - }, - { - "id": "mxfp8", - "file": "mxfp8_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 256, - "source": "generated by gen_all_formats.py", - "sha256": "16eedca7e82c4e6753f8248dce0000ba9a50ba09bab9be747b0dcac3efc21b6b", - "witnesses": 0 - }, - { - "id": "mxfp6", - "file": "mxfp6_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 64, - "source": "generated by gen_all_formats.py", - "sha256": "3db420779597b673a691d409b1fc11aee8168549c55be1c8ebfb70dc8330e0c7", - "witnesses": 0 - }, - { - "id": "mxfp4", - "file": "mxfp4_e2m1_conformance_v0.json", - "kind": "bitexact", - "source": "hand-curated (pre-existing)", - "sha256": "b5795fed0c0f2b580174b443d2c54519c4953916525237bb7ea7d6831f14fde7", - "witnesses": 0 - }, - { - "id": "nf4", - "file": "nf4_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 16, - "source": "generated by gen_all_formats.py", - "sha256": "723ddd4237153c7c0cc6a9c3436ba071f8affcef8ad0c384070a3e1a3bf13f45", - "witnesses": 0 - }, - { - "id": "afp", - "file": "afp_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "384a16af29fe5305d07a2eb07f9056cf0b6fe0d97b83eb3f04fcba90f2397f32", - "witnesses": 0 - }, - { - "id": "posit8", - "file": "posit8_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 256, - "source": "generated by gen_all_formats.py", - "sha256": "0c638ef95b6537e4dc0e256dc1ca2d9363152b3d5a800501472230ce98a84b76", - "witnesses": 0 - }, - { - "id": "posit16", - "file": "posit16_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "7cc2edfeb0f52769b1a536dcbe04945a301cdcc3799a23267380b0c4fb0b82d5", - "witnesses": 0 - }, - { - "id": "posit32", - "file": "posit32_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "aee6cc72691a0ae211e39bf6315ac68a5fe74e87190e0c27088871c6ccc87f52", - "witnesses": 0 - }, - { - "id": "posit64", - "file": "posit64_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "66b14056938549c1aaa522097ee8744246581cf6d3bb6002cef3b2f3f6ea0ff6", - "witnesses": 0 - }, - { - "id": "takum8", - "file": "takum8_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 256, - "source": "generated by gen_all_formats.py", - "sha256": "e81b280fbd1a30381c169760b24b5686db82eff8debcc5412cb43d1a0be9a05f", - "witnesses": 0 - }, - { - "id": "takum16", - "file": "takum16_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 3, - "source": "generated by gen_all_formats.py", - "sha256": "924a2e5626df001d2780f542f5aff0c0152a8c819f35866dce2e2152409c1a11", - "witnesses": 0 - }, - { - "id": "takum32", - "file": "takum32_conformance_v0.json", - "kind": "bitexact", - "source": "hand-curated (pre-existing)", - "sha256": "c5b034ff12169e921ce3a9411a0317ccd85003dde6c71c8461ced3fd73b3c80f", - "witnesses": 4 - }, - { - "id": "takum64", - "file": "takum64_conformance_v0.json", - "kind": "bitexact", - "source": "hand-curated (pre-existing)", - "sha256": "1c4fc6d0579626ed364e9044aa455df4f1a1984b8b14cd370004498d86f73a0c", - "witnesses": 4 - }, - { - "id": "lns8", - "file": "lns8_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 256, - "source": "generated by gen_all_formats.py", - "sha256": "1cb3ca966b7564b15d6b64b37efb4548fa4b6ff26686576cf5da9ac7657379b8", - "witnesses": 0 - }, - { - "id": "lns16", - "file": "lns16_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 5, - "source": "generated by gen_all_formats.py", - "sha256": "0b4b9d4ce2162e079239aa05e742c7f699453b96f6a8abd90c17bca95d88eff6", - "witnesses": 0 - }, - { - "id": "lns32", - "file": "lns32_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 5, - "source": "generated by gen_all_formats.py", - "sha256": "7877795b137b599bafb64e8c4b114e128a2ef5af433db222b2875e0df6919872", - "witnesses": 0 - }, - { - "id": "lns64", - "file": "lns64_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 5, - "source": "generated by gen_all_formats.py", - "sha256": "9969a97f62be45bc120cc2310b5be5c0e6c83d3151a51d6fbb5173db54581ec0", - "witnesses": 0 - }, - { - "id": "gfternary", - "file": "gfternary_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 4, - "source": "generated by gen_all_formats.py", - "sha256": "9f246d24511fbff6fb9e83e60e1bedfce401052537f7c8929fe205d0f6e57b81", - "witnesses": 0 - }, - { - "id": "gf4", - "file": "gf4_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 16, - "source": "generated by gen_all_formats.py", - "sha256": "25471b7a0e3dc3633118191e722ced2f450a3ed8a6228ad2492f92084f556f96", - "witnesses": 0 - }, - { - "id": "gf8", - "file": "gf8_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 256, - "source": "generated by gen_all_formats.py", - "sha256": "6dccbc6628cbc051e06a006a0731499970c1d99e65fc0d42d9007d8f0ed1402d", - "witnesses": 0 - }, - { - "id": "gf12", - "file": "gf12_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "ea00efde4825931a421ec9feb5910f3ad9ab7ab5d38a77d2c364ea9fa49a7f96", - "witnesses": 0 - }, - { - "id": "gf16", - "file": "gf16_conformance_v0.json", - "kind": "bitexact", - "source": "hand-curated (pre-existing)", - "sha256": "d1c0eb5bd66247b3c5db9a00a95e29cf4359653aec56f2f9e6827f96898d1509", - "witnesses": 0 - }, - { - "id": "gf20", - "file": "gf20_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "76c7814558901d5633cb16ffead7468583de5577c4ccf0378c296c73ae08acc5", - "witnesses": 0 - }, - { - "id": "gf24", - "file": "gf24_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "983642c7aea54b7e6c5b6e41edcf20828bfc3a1f2707307eaa713ca5a45e612c", - "witnesses": 0 - }, - { - "id": "gf32", - "file": "gf32_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "f7222e2442f2c106e7f3590e5dbe8ed177603fc2324560987af138ae9abeceb4", - "witnesses": 0 - }, - { - "id": "gf64", - "file": "gf64_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "887223d0bc8b00d76b70238ddbc8933e3a773ed6a9fbc10264d9fdbebca76cd3", - "witnesses": 0 - }, - { - "id": "gf6", - "file": "gf6_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 64, - "source": "generated by gen_all_formats.py", - "sha256": "9c9fc955db5f6c9b185bdd5d88bd92f3f21a71ad4d784b944330d5cba85fb724", - "witnesses": 0 - }, - { - "id": "gf10", - "file": "gf10_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "af62499491faf340d7940b0b10ab0208745e57faa97bbe19588fe1d879db485b", - "witnesses": 0 - }, - { - "id": "gf14", - "file": "gf14_conformance_v0.json", - "kind": "bitexact", - "source": "pre-existing pack + recorded independent witness", - "n_vectors": 14, - "sha256": "e2364f36a4cb5812b81d2f8f4253688b4d269201463c8481e18568438114a718", - "witnesses": 1 - }, - { - "id": "gf48", - "file": "gf48_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 15, - "source": "wide-rung GoldenFloat oracle promoted to strict bitexact by an independent second decoder (gf_wide_independent_witness.py, dyadic-exact, abs_error=0) + golden Fraction oracle + FP64 RTL bit-model (224255/224255)", - "sha256": "d9928025d21fa0e0f0c02904d9a3e20f5f12a7811b57fa474e8a325ded43e91a", - "witnesses": 3 - }, - { - "id": "gf96", - "file": "gf96_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 15, - "source": "wide-rung GoldenFloat exact-dyadic pack promoted to strict bitexact by an analytic zero-rounding separation-bound + two structurally independent exact decoders (dyadic gf_wide_independent_witness.py + Fraction oracle gf96_decode_ref.py), 15/15 abs_error=0, 201512-code cross-check", - "sha256": "43127e758d653d26640d38801d42d4daf36fdc70df66a63aadac6a8ce06159fa", - "witnesses": 3 - }, - { - "id": "gf128", - "file": "gf128_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 15, - "source": "promoted selfconsistent->strict bitexact (dual exact path + separation-bound; gf128 PR)", - "sha256": "cda05a8e608038f3ebb53757ecbe0f78a650f959cf34a54b0cf26d80730e54d3", - "witnesses": 3 - }, - { - "id": "gf256", - "file": "gf256_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 2021, - "source": "promoted selfconsistent->strict bitexact (dual exact path + separation-bound; bias audit resolved decode-bias=2^96-1 closed form; gf256 promote PR)", - "sha256": "f504258daa4c537ff11a9863814470dd0731ab8cca988093d72e83c221c425f1", - "witnesses": 3 - }, - { - "id": "gf512", - "file": "gf512_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 15, - "source": "promoted selfconsistent->strict bitexact (dual exact path + separation-bound; gf512 paired PR)", - "sha256": "08d32005ba118c4d0d4a61cb47e074ffd7131a41ca84d4debcac4ebfdfcef9cd", - "witnesses": 3 - }, - { - "id": "gf1024", - "file": "gf1024_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 15, - "source": "promoted selfconsistent->strict bitexact (dual exact path + separation-bound; gf1024 paired PR)", - "sha256": "1e1613e3e1d1a11deae5c99408a2581244c2cb98c203d429b24247905d188df4", - "witnesses": 3 - }, - { - "id": "gf8_bfp", - "file": "gf8_bfp_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 256, - "source": "generated by gen_all_formats.py", - "sha256": "fe600234cab0e589b69d84e673d74729cff153f9e4e63e871e285fa82ad2cc70", - "witnesses": 0 - }, - { - "id": "gf_lns_hybrid", - "file": "gf_lns_hybrid_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "eb7c946281fb6ed6fadd9c63c7e7fa186412480910c9fedcb25fbc056c1bd34a", - "witnesses": 0 - }, - { - "id": "mxgf6", - "file": "mxgf6_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 64, - "source": "generated by gen_all_formats.py", - "sha256": "9d77d8be5522942e9276b723915b3223123b7741a076a1bfd819cc73ab29f1ec", - "witnesses": 0 - }, - { - "id": "mxgf4", - "file": "mxgf4_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 16, - "source": "generated by gen_all_formats.py", - "sha256": "5e8d03fe80c59b458dc4bbd3fba3213dbc00626d8bc73b2cfcc09836539e89fb", - "witnesses": 0 - }, - { - "id": "int4", - "file": "int4_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 16, - "source": "generated by gen_all_formats.py", - "sha256": "ec35d81224f9635c21b53165e123d1b6b0ed13ad3c1d7ec830e018df22c46ad1", - "witnesses": 0 - }, - { - "id": "int8", - "file": "int8_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 256, - "source": "generated by gen_all_formats.py", - "sha256": "3e7358f28f5d242e24a46fcf0359e24e21bb4f54834e88b38235fc6332e86978", - "witnesses": 0 - }, - { - "id": "int16", - "file": "int16_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 7, - "source": "generated by gen_all_formats.py", - "sha256": "a14f51cd6b29bef2215573bc7f1d299559d5d34af36fd0ffceb513f0659765b9", - "witnesses": 0 - }, - { - "id": "int32", - "file": "int32_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 7, - "source": "generated by gen_all_formats.py", - "sha256": "e7f8ddbc4f8606a83febb5c8836f38a143c28f650d73330af5650ea698d91570", - "witnesses": 0 - }, - { - "id": "int64", - "file": "int64_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 7, - "source": "generated by gen_all_formats.py", - "sha256": "15e7ae6bd373de5b4f755c71877d6bb662c241526f3a5f4ead22307764f754f5", - "witnesses": 0 - }, - { - "id": "int128", - "file": "int128_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 7, - "source": "generated by gen_all_formats.py", - "sha256": "df77519366e4c59888dcfafa66c20db4389e162f7dae96767684f46d8427d9fc", - "witnesses": 0 - }, - { - "id": "q_format", - "file": "q_format_conformance_v0.json", - "kind": "structural", - "n_vectors": 0, - "source": "generated by gen_all_formats.py", - "sha256": "2bc0c114aecd1d0dbfa7925efe298cea80efd510022ee0734cf9450af8027b63", - "witnesses": 0 - }, - { - "id": "bcd", - "file": "bcd_conformance_v0.json", - "kind": "bitexact", - "source": "hand-curated (pre-existing)", - "sha256": "637912a0b8d1a4a1e5a50ddafa2c6dbc8e44c7e96218fb8c70763bc69de505cb", - "witnesses": 3 - }, - { - "id": "ibm_hfp32", - "file": "ibm_hfp32_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "8e35040e30d3a0091ecca5fdb08d1dd1ce98031e5d655239c7196bc667fc3876", - "witnesses": 0 - }, - { - "id": "ibm_hfp64", - "file": "ibm_hfp64_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "fbe42a167c13f226fe8eaf876c9e17109fb32dbddd76d3a677cc0b9aef2626a1", - "witnesses": 0 - }, - { - "id": "ibm_hfp128", - "file": "ibm_hfp128_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "2f02899d621a8a7aebfdf2a69a2484d7616c61ac7cebdc483f643e8109c4e31f", - "witnesses": 0 - }, - { - "id": "ms_mbf32", - "file": "ms_mbf32_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "260382da8c40576d046d6d044753522e1c3730e55a4712f21e91b21ad918c365", - "witnesses": 0 - }, - { - "id": "ms_mbf64", - "file": "ms_mbf64_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "8d750f03d47a4113548a5e57be2201d4b7f5689143b3605a9a51a60b49988ec9", - "witnesses": 0 - }, - { - "id": "vax_f", - "file": "vax_f_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "a7f45aec8da42931da5ad9f24c3ee369419ec58a783abe657a275210ae9b1e4d", - "witnesses": 0 - }, - { - "id": "vax_d", - "file": "vax_d_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "b87494ddee38fe68f77dd8082e8a9811530cc346526b80e59c81b17665677792", - "witnesses": 0 - }, - { - "id": "vax_g", - "file": "vax_g_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "9a6372bbf85a50457e0b66db8849845333582e3fef28934047963e89dd95e65a", - "witnesses": 0 - }, - { - "id": "vax_h", - "file": "vax_h_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "eaaa44e4ce2e5454da2cc83571bf3261a84a1b6fabb0dc8064c04cd71fa581f0", - "witnesses": 0 - }, - { - "id": "cray_float", - "file": "cray_float_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 8, - "source": "generated by gen_all_formats.py", - "sha256": "b1a8f6652112be3f49949bafe9f6cd7f46f0271e8f4e19cadb55c2a0e972f503", - "witnesses": 0 - }, - { - "id": "minifloat", - "file": "minifloat_conformance_v0.json", - "kind": "structural", - "n_vectors": 0, - "source": "generated by gen_all_formats.py", - "sha256": "d42d1d167c5aa9f504de5ca9ebc04cbd863ff5ebb300fbcb09306413d7b334c3", - "witnesses": 0 - }, - { - "id": "unum_i", - "file": "unum_i_conformance_v0.json", - "kind": "structural", - "n_vectors": 0, - "source": "generated by gen_all_formats.py", - "sha256": "2b28ce1eca1f39623122fbdd853945d05c73adc47e132c250e6ccb56217d689b", - "witnesses": 0 - }, - { - "id": "unum_ii", - "file": "unum_ii_conformance_v0.json", - "kind": "structural", - "n_vectors": 0, - "source": "generated by gen_all_formats.py", - "sha256": "a79c4cdca84fc702a4ce25fd36040912f841dc9d75f35476e78dbbdfc6fb12f8", - "witnesses": 0 - }, - { - "id": "tapered_fp", - "file": "tapered_fp_conformance_v0.json", - "kind": "structural", - "n_vectors": 0, - "source": "generated by gen_all_formats.py", - "sha256": "e20d828fda7d3d6b86d047b390fae2964622b83fb8200220f5a4283bc5ae2b4b", - "witnesses": 0 - }, - { - "id": "block_fp", - "file": "block_fp_conformance_v0.json", - "kind": "structural", - "n_vectors": 0, - "source": "generated by gen_all_formats.py", - "sha256": "3129fa92145096e55527c2fc22d9e6bed23db1a6d88148e8b711a3b6641a43c1", - "witnesses": 0 - }, - { - "id": "shared_exp", - "file": "shared_exp_conformance_v0.json", - "kind": "structural", - "n_vectors": 0, - "source": "generated by gen_all_formats.py", - "sha256": "ca139ebd7bc5c139357c533bb0a6509e4edd05044d7869fcea57cf34d052c3c7", - "witnesses": 0 - }, - { - "id": "per_channel_scale", - "file": "per_channel_scale_conformance_v0.json", - "kind": "bitexact", - "n_vectors": 256, - "source": "generated by gen_all_formats.py", - "sha256": "d60b7dacff5f609455f5f0da2011ac6ab6f276097d6a21f477d21be82c8457e5", - "witnesses": 0 - }, - { - "id": "stochastic_rounding", - "file": "stochastic_rounding_conformance_v0.json", - "kind": "structural", - "n_vectors": 0, - "source": "generated by gen_all_formats.py", - "sha256": "fc2a0a6dcce7bbb0eccc1e23ebdacb9abbd81cd54111796be6dc7e6a87a2071a", - "witnesses": 0 - } - ] -} \ No newline at end of file + "schema": "t27-conformance-index/v0.1", + "anchor_identity": "phi^2 + 1/phi^2 = 3", + "ssot": "https://github.com/gHashTag/t27/blob/master/conformance/FORMAT-SPEC-001.json", + "preprint": "https://arxiv.org/abs/2606.05017", + "total_formats": 92, + "total_packs": 92, + "bitexact_packs": 84, + "selfconsistent_packs": 0, + "structural_packs": 8, + "witnessed_packs": 10, + "packs": [ + { + "id": "afp", + "file": "afp_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "384a16af29fe5305d07a2eb07f9056cf0b6fe0d97b83eb3f04fcba90f2397f32", + "witnesses": 0 + }, + { + "id": "bcd", + "file": "bcd_conformance_v0.json", + "kind": "bitexact", + "source": "hand-curated (pre-existing)", + "sha256": "637912a0b8d1a4a1e5a50ddafa2c6dbc8e44c7e96218fb8c70763bc69de505cb", + "witnesses": 3 + }, + { + "id": "bfloat16", + "file": "bf16_golden_conformance_v0.json", + "kind": "bitexact", + "source": "hand-curated (pre-existing)", + "sha256": "98bbddcbb8a520dc45a6dfed7209c50a0acc0fabc4d3b430359969467eee4e13", + "witnesses": 0 + }, + { + "id": "binary128", + "file": "binary128_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "9d08a8a6a10f94e875f73e5f44643f088435a570bfafaef9991464d5377b26e0", + "witnesses": 0 + }, + { + "id": "binary16", + "file": "binary16_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "84fd7629430b06d761ac3b92fc85208c472a4582040b1ac2001cc87a6612f7b4", + "witnesses": 0 + }, + { + "id": "binary256", + "file": "binary256_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "43d39ae4c4808276ba1ed5b2d8c221c17983a53570da2fc161996b0f7ea3aee3", + "witnesses": 0 + }, + { + "id": "binary32", + "file": "binary32_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "9dc16a1c3b65b7f7a5d59c546886ed12e99fb37cbfc9f3d5d45813921e6a70ff", + "witnesses": 0 + }, + { + "id": "binary64", + "file": "binary64_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "1d3e3d6daee576ae3b2b4dca6f26560390535fb7441a54b389f98a4238e58bec", + "witnesses": 0 + }, + { + "id": "block_fp", + "file": "block_fp_conformance_v0.json", + "kind": "structural", + "n_vectors": 0, + "source": "generated by gen_all_formats.py", + "sha256": "3129fa92145096e55527c2fc22d9e6bed23db1a6d88148e8b711a3b6641a43c1", + "witnesses": 0 + }, + { + "id": "cray_float", + "file": "cray_float_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "b1a8f6652112be3f49949bafe9f6cd7f46f0271e8f4e19cadb55c2a0e972f503", + "witnesses": 0 + }, + { + "id": "decimal128", + "file": "decimal128_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "84dbc594340717415385b3bd86eb20432f5430aba047557579f2e2a96de0dc2d", + "witnesses": 0 + }, + { + "id": "decimal32", + "file": "decimal32_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 7, + "source": "generated by gen_all_formats.py", + "sha256": "e13bc9cd6bc33545ab55f575e23d2343418ded5eddf1395b61f31321dc7d272e", + "witnesses": 0 + }, + { + "id": "decimal64", + "file": "decimal64_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 7, + "source": "generated by gen_all_formats.py", + "sha256": "fedef68cfe1b910e737574bbe331dc19fbe1724edbd35ec8beac89b1595bea0d", + "witnesses": 0 + }, + { + "id": "double_double", + "file": "double_double_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "f8dc9608093afada65df94852a9b78c3a4a5466415389c5ec359afd19d3b208c", + "witnesses": 0 + }, + { + "id": "fp4_e2m1", + "file": "fp4_e2m1_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 16, + "source": "generated by gen_all_formats.py", + "sha256": "8ded6625c4644139320dd89b2b7815d6ba27177c35b7d645b2d93b8cfdc63fd9", + "witnesses": 0 + }, + { + "id": "fp6_e2m3", + "file": "fp6_e2m3_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 64, + "source": "generated by gen_all_formats.py", + "sha256": "de70d6aacf0ac2d47decae0866d14f126058176428315d4c767e460c0a9ae5e5", + "witnesses": 0 + }, + { + "id": "fp6_e3m2", + "file": "fp6_e3m2_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 64, + "source": "generated by gen_all_formats.py", + "sha256": "17a80f0a3b5b2495dbcd6de6062d8c1f8ce19b9746d1e370e6d16897ef5f9c02", + "witnesses": 0 + }, + { + "id": "fp8_e4m3", + "file": "fp8_e4m3fn_conformance_v0.json", + "kind": "bitexact", + "source": "hand-curated (pre-existing)", + "sha256": "7193ccd0d330d3e05154432abcec5da4a4c170e11004d4ffa44ff5cbbff9cba9", + "witnesses": 0 + }, + { + "id": "fp8_e5m2", + "file": "fp8_e5m2_conformance_v0.json", + "kind": "bitexact", + "source": "hand-curated (pre-existing)", + "sha256": "9c31fbd03923bd6555304848a092504dfbc02f72d2be82d2b80f49243e925a18", + "witnesses": 0 + }, + { + "id": "gf10", + "file": "gf10_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "af62499491faf340d7940b0b10ab0208745e57faa97bbe19588fe1d879db485b", + "witnesses": 0 + }, + { + "id": "gf1024", + "file": "gf1024_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 15, + "source": "promoted selfconsistent->strict bitexact (dual exact path + separation-bound; gf1024 paired PR)", + "sha256": "1e1613e3e1d1a11deae5c99408a2581244c2cb98c203d429b24247905d188df4", + "witnesses": 3 + }, + { + "id": "gf12", + "file": "gf12_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "ea00efde4825931a421ec9feb5910f3ad9ab7ab5d38a77d2c364ea9fa49a7f96", + "witnesses": 0 + }, + { + "id": "gf128", + "file": "gf128_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 15, + "source": "promoted selfconsistent->strict bitexact (dual exact path + separation-bound; gf128 PR)", + "sha256": "cda05a8e608038f3ebb53757ecbe0f78a650f959cf34a54b0cf26d80730e54d3", + "witnesses": 3 + }, + { + "id": "gf14", + "file": "gf14_conformance_v0.json", + "kind": "bitexact", + "source": "pre-existing pack + recorded independent witness", + "n_vectors": 14, + "sha256": "e2364f36a4cb5812b81d2f8f4253688b4d269201463c8481e18568438114a718", + "witnesses": 1 + }, + { + "id": "gf16", + "file": "gf16_conformance_v0.json", + "kind": "bitexact", + "source": "hand-curated (pre-existing)", + "sha256": "d1c0eb5bd66247b3c5db9a00a95e29cf4359653aec56f2f9e6827f96898d1509", + "witnesses": 0 + }, + { + "id": "gf20", + "file": "gf20_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "76c7814558901d5633cb16ffead7468583de5577c4ccf0378c296c73ae08acc5", + "witnesses": 0 + }, + { + "id": "gf24", + "file": "gf24_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "983642c7aea54b7e6c5b6e41edcf20828bfc3a1f2707307eaa713ca5a45e612c", + "witnesses": 0 + }, + { + "id": "gf256", + "file": "gf256_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 2021, + "source": "promoted selfconsistent->strict bitexact (dual exact path + separation-bound; bias audit resolved decode-bias=2^96-1 closed form; gf256 promote PR)", + "sha256": "f504258daa4c537ff11a9863814470dd0731ab8cca988093d72e83c221c425f1", + "witnesses": 3 + }, + { + "id": "gf32", + "file": "gf32_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "f7222e2442f2c106e7f3590e5dbe8ed177603fc2324560987af138ae9abeceb4", + "witnesses": 0 + }, + { + "id": "gf4", + "file": "gf4_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 16, + "source": "generated by gen_all_formats.py", + "sha256": "25471b7a0e3dc3633118191e722ced2f450a3ed8a6228ad2492f92084f556f96", + "witnesses": 0 + }, + { + "id": "gf48", + "file": "gf48_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 15, + "source": "wide-rung GoldenFloat oracle promoted to strict bitexact by an independent second decoder (gf_wide_independent_witness.py, dyadic-exact, abs_error=0) + golden Fraction oracle + FP64 RTL bit-model (224255/224255)", + "sha256": "d9928025d21fa0e0f0c02904d9a3e20f5f12a7811b57fa474e8a325ded43e91a", + "witnesses": 3 + }, + { + "id": "gf512", + "file": "gf512_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 15, + "source": "promoted selfconsistent->strict bitexact (dual exact path + separation-bound; gf512 paired PR)", + "sha256": "08d32005ba118c4d0d4a61cb47e074ffd7131a41ca84d4debcac4ebfdfcef9cd", + "witnesses": 3 + }, + { + "id": "gf6", + "file": "gf6_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 64, + "source": "generated by gen_all_formats.py", + "sha256": "9c9fc955db5f6c9b185bdd5d88bd92f3f21a71ad4d784b944330d5cba85fb724", + "witnesses": 0 + }, + { + "id": "gf64", + "file": "gf64_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "887223d0bc8b00d76b70238ddbc8933e3a773ed6a9fbc10264d9fdbebca76cd3", + "witnesses": 0 + }, + { + "id": "gf8", + "file": "gf8_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 256, + "source": "generated by gen_all_formats.py", + "sha256": "6dccbc6628cbc051e06a006a0731499970c1d99e65fc0d42d9007d8f0ed1402d", + "witnesses": 0 + }, + { + "id": "gf8_bfp", + "file": "gf8_bfp_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 256, + "source": "generated by gen_all_formats.py", + "sha256": "fe600234cab0e589b69d84e673d74729cff153f9e4e63e871e285fa82ad2cc70", + "witnesses": 0 + }, + { + "id": "gf96", + "file": "gf96_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 15, + "source": "wide-rung GoldenFloat exact-dyadic pack promoted to strict bitexact by an analytic zero-rounding separation-bound + two structurally independent exact decoders (dyadic gf_wide_independent_witness.py + Fraction oracle gf96_decode_ref.py), 15/15 abs_error=0, 201512-code cross-check", + "sha256": "43127e758d653d26640d38801d42d4daf36fdc70df66a63aadac6a8ce06159fa", + "witnesses": 3 + }, + { + "id": "gf_lns_hybrid", + "file": "gf_lns_hybrid_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "eb7c946281fb6ed6fadd9c63c7e7fa186412480910c9fedcb25fbc056c1bd34a", + "witnesses": 0 + }, + { + "id": "gft1024", + "file": "gft1024_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 22, + "source": "generated from conformance/gft_ref.py (round-trip verified 90/90)", + "sha256": "bc3921e8f7836337bffeefe64e8e963b2ec5054f60f2a7c967c6851604d2e5ed" + }, + { + "id": "gft128", + "file": "gft128_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 22, + "source": "generated from conformance/gft_ref.py (round-trip verified 90/90)", + "sha256": "cd4d2a28cf0cdbb3db4813dd2ab920a565f326e8fad502a8101cba859fbfc7fc" + }, + { + "id": "gft16", + "file": "gft16_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 22, + "source": "generated from conformance/gft_ref.py (round-trip verified 90/90)", + "sha256": "e52e252a8023f4efc90f786f34c8dc4d4aa9f5ded251c1a344d5a3358ad5a54e" + }, + { + "id": "gft256", + "file": "gft256_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 22, + "source": "generated from conformance/gft_ref.py (round-trip verified 90/90)", + "sha256": "a7d926eadff5a2f5ba857f4b8eeb912b446a0e5567bc5c8b23fcd5fee442b7c6" + }, + { + "id": "gft32", + "file": "gft32_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 22, + "source": "generated from conformance/gft_ref.py (round-trip verified 90/90)", + "sha256": "a16ddf491e5585eea378c86b3cbc281b06f72d496978dba5272140c83c8e12db" + }, + { + "id": "gft4", + "file": "gft4_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 16, + "source": "generated from conformance/gft_ref.py (round-trip verified 90/90)", + "sha256": "c065831d11b87660987ef8f2b80766e5ca361dc38f59842f847b774c12a14184" + }, + { + "id": "gft512", + "file": "gft512_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 22, + "source": "generated from conformance/gft_ref.py (round-trip verified 90/90)", + "sha256": "b5c97e2d7e3f2a1d638258503e31f4e4c42ab2ed15fb5dd6066baa20a0f4f99c" + }, + { + "id": "gft64", + "file": "gft64_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 22, + "source": "generated from conformance/gft_ref.py (round-trip verified 90/90)", + "sha256": "98e6c3c0a4cbe9da07686064c84db261686deded19dcc846e97314a38cc7a0b6" + }, + { + "id": "gft8", + "file": "gft8_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 22, + "source": "generated from conformance/gft_ref.py (round-trip verified 90/90)", + "sha256": "97c97737bc7fe959a991481c4a917f004d1bec6538e2e1d85da10413eeb6cd24" + }, + { + "id": "gfternary", + "file": "gfternary_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 4, + "source": "generated by gen_all_formats.py", + "sha256": "9f246d24511fbff6fb9e83e60e1bedfce401052537f7c8929fe205d0f6e57b81", + "witnesses": 0 + }, + { + "id": "ibm_hfp128", + "file": "ibm_hfp128_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "2f02899d621a8a7aebfdf2a69a2484d7616c61ac7cebdc483f643e8109c4e31f", + "witnesses": 0 + }, + { + "id": "ibm_hfp32", + "file": "ibm_hfp32_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "8e35040e30d3a0091ecca5fdb08d1dd1ce98031e5d655239c7196bc667fc3876", + "witnesses": 0 + }, + { + "id": "ibm_hfp64", + "file": "ibm_hfp64_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "fbe42a167c13f226fe8eaf876c9e17109fb32dbddd76d3a677cc0b9aef2626a1", + "witnesses": 0 + }, + { + "id": "int128", + "file": "int128_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 7, + "source": "generated by gen_all_formats.py", + "sha256": "df77519366e4c59888dcfafa66c20db4389e162f7dae96767684f46d8427d9fc", + "witnesses": 0 + }, + { + "id": "int16", + "file": "int16_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 7, + "source": "generated by gen_all_formats.py", + "sha256": "a14f51cd6b29bef2215573bc7f1d299559d5d34af36fd0ffceb513f0659765b9", + "witnesses": 0 + }, + { + "id": "int32", + "file": "int32_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 7, + "source": "generated by gen_all_formats.py", + "sha256": "e7f8ddbc4f8606a83febb5c8836f38a143c28f650d73330af5650ea698d91570", + "witnesses": 0 + }, + { + "id": "int4", + "file": "int4_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 16, + "source": "generated by gen_all_formats.py", + "sha256": "ec35d81224f9635c21b53165e123d1b6b0ed13ad3c1d7ec830e018df22c46ad1", + "witnesses": 0 + }, + { + "id": "int64", + "file": "int64_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 7, + "source": "generated by gen_all_formats.py", + "sha256": "15e7ae6bd373de5b4f755c71877d6bb662c241526f3a5f4ead22307764f754f5", + "witnesses": 0 + }, + { + "id": "int8", + "file": "int8_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 256, + "source": "generated by gen_all_formats.py", + "sha256": "3e7358f28f5d242e24a46fcf0359e24e21bb4f54834e88b38235fc6332e86978", + "witnesses": 0 + }, + { + "id": "lns16", + "file": "lns16_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 5, + "source": "generated by gen_all_formats.py", + "sha256": "0b4b9d4ce2162e079239aa05e742c7f699453b96f6a8abd90c17bca95d88eff6", + "witnesses": 0 + }, + { + "id": "lns32", + "file": "lns32_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 5, + "source": "generated by gen_all_formats.py", + "sha256": "7877795b137b599bafb64e8c4b114e128a2ef5af433db222b2875e0df6919872", + "witnesses": 0 + }, + { + "id": "lns64", + "file": "lns64_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 5, + "source": "generated by gen_all_formats.py", + "sha256": "9969a97f62be45bc120cc2310b5be5c0e6c83d3151a51d6fbb5173db54581ec0", + "witnesses": 0 + }, + { + "id": "lns8", + "file": "lns8_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 256, + "source": "generated by gen_all_formats.py", + "sha256": "1cb3ca966b7564b15d6b64b37efb4548fa4b6ff26686576cf5da9ac7657379b8", + "witnesses": 0 + }, + { + "id": "minifloat", + "file": "minifloat_conformance_v0.json", + "kind": "structural", + "n_vectors": 0, + "source": "generated by gen_all_formats.py", + "sha256": "d42d1d167c5aa9f504de5ca9ebc04cbd863ff5ebb300fbcb09306413d7b334c3", + "witnesses": 0 + }, + { + "id": "ms_mbf32", + "file": "ms_mbf32_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "260382da8c40576d046d6d044753522e1c3730e55a4712f21e91b21ad918c365", + "witnesses": 0 + }, + { + "id": "ms_mbf64", + "file": "ms_mbf64_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "8d750f03d47a4113548a5e57be2201d4b7f5689143b3605a9a51a60b49988ec9", + "witnesses": 0 + }, + { + "id": "mxfp4", + "file": "mxfp4_e2m1_conformance_v0.json", + "kind": "bitexact", + "source": "hand-curated (pre-existing)", + "sha256": "b5795fed0c0f2b580174b443d2c54519c4953916525237bb7ea7d6831f14fde7", + "witnesses": 0 + }, + { + "id": "mxfp6", + "file": "mxfp6_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 64, + "source": "generated by gen_all_formats.py", + "sha256": "3db420779597b673a691d409b1fc11aee8168549c55be1c8ebfb70dc8330e0c7", + "witnesses": 0 + }, + { + "id": "mxfp8", + "file": "mxfp8_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 256, + "source": "generated by gen_all_formats.py", + "sha256": "16eedca7e82c4e6753f8248dce0000ba9a50ba09bab9be747b0dcac3efc21b6b", + "witnesses": 0 + }, + { + "id": "mxgf4", + "file": "mxgf4_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 16, + "source": "generated by gen_all_formats.py", + "sha256": "5e8d03fe80c59b458dc4bbd3fba3213dbc00626d8bc73b2cfcc09836539e89fb", + "witnesses": 0 + }, + { + "id": "mxgf6", + "file": "mxgf6_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 64, + "source": "generated by gen_all_formats.py", + "sha256": "9d77d8be5522942e9276b723915b3223123b7741a076a1bfd819cc73ab29f1ec", + "witnesses": 0 + }, + { + "id": "nf4", + "file": "nf4_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 16, + "source": "generated by gen_all_formats.py", + "sha256": "723ddd4237153c7c0cc6a9c3436ba071f8affcef8ad0c384070a3e1a3bf13f45", + "witnesses": 0 + }, + { + "id": "per_channel_scale", + "file": "per_channel_scale_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 256, + "source": "generated by gen_all_formats.py", + "sha256": "d60b7dacff5f609455f5f0da2011ac6ab6f276097d6a21f477d21be82c8457e5", + "witnesses": 0 + }, + { + "id": "posit16", + "file": "posit16_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "7cc2edfeb0f52769b1a536dcbe04945a301cdcc3799a23267380b0c4fb0b82d5", + "witnesses": 0 + }, + { + "id": "posit32", + "file": "posit32_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "aee6cc72691a0ae211e39bf6315ac68a5fe74e87190e0c27088871c6ccc87f52", + "witnesses": 0 + }, + { + "id": "posit64", + "file": "posit64_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "66b14056938549c1aaa522097ee8744246581cf6d3bb6002cef3b2f3f6ea0ff6", + "witnesses": 0 + }, + { + "id": "posit8", + "file": "posit8_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 256, + "source": "generated by gen_all_formats.py", + "sha256": "0c638ef95b6537e4dc0e256dc1ca2d9363152b3d5a800501472230ce98a84b76", + "witnesses": 0 + }, + { + "id": "q_format", + "file": "q_format_conformance_v0.json", + "kind": "structural", + "n_vectors": 0, + "source": "generated by gen_all_formats.py", + "sha256": "2bc0c114aecd1d0dbfa7925efe298cea80efd510022ee0734cf9450af8027b63", + "witnesses": 0 + }, + { + "id": "quad_double", + "file": "quad_double_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "62ef8067fd1d70ef0abac77d4b0252a3686b9cd698ee4806e0bc1e01bcfe7cfa", + "witnesses": 0 + }, + { + "id": "shared_exp", + "file": "shared_exp_conformance_v0.json", + "kind": "structural", + "n_vectors": 0, + "source": "generated by gen_all_formats.py", + "sha256": "ca139ebd7bc5c139357c533bb0a6509e4edd05044d7869fcea57cf34d052c3c7", + "witnesses": 0 + }, + { + "id": "stochastic_rounding", + "file": "stochastic_rounding_conformance_v0.json", + "kind": "structural", + "n_vectors": 0, + "source": "generated by gen_all_formats.py", + "sha256": "fc2a0a6dcce7bbb0eccc1e23ebdacb9abbd81cd54111796be6dc7e6a87a2071a", + "witnesses": 0 + }, + { + "id": "takum16", + "file": "takum16_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 3, + "source": "generated by gen_all_formats.py", + "sha256": "924a2e5626df001d2780f542f5aff0c0152a8c819f35866dce2e2152409c1a11", + "witnesses": 0 + }, + { + "id": "takum32", + "file": "takum32_conformance_v0.json", + "kind": "bitexact", + "source": "hand-curated (pre-existing)", + "sha256": "c5b034ff12169e921ce3a9411a0317ccd85003dde6c71c8461ced3fd73b3c80f", + "witnesses": 4 + }, + { + "id": "takum64", + "file": "takum64_conformance_v0.json", + "kind": "bitexact", + "source": "hand-curated (pre-existing)", + "sha256": "1c4fc6d0579626ed364e9044aa455df4f1a1984b8b14cd370004498d86f73a0c", + "witnesses": 4 + }, + { + "id": "takum8", + "file": "takum8_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 256, + "source": "generated by gen_all_formats.py", + "sha256": "e81b280fbd1a30381c169760b24b5686db82eff8debcc5412cb43d1a0be9a05f", + "witnesses": 0 + }, + { + "id": "tapered_fp", + "file": "tapered_fp_conformance_v0.json", + "kind": "structural", + "n_vectors": 0, + "source": "generated by gen_all_formats.py", + "sha256": "e20d828fda7d3d6b86d047b390fae2964622b83fb8200220f5a4283bc5ae2b4b", + "witnesses": 0 + }, + { + "id": "tf32", + "file": "tf32_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "b35c334092b49dad9a944d37a91697f08f442b633142e81c69296c12bac0055d", + "witnesses": 0 + }, + { + "id": "unum_i", + "file": "unum_i_conformance_v0.json", + "kind": "structural", + "n_vectors": 0, + "source": "generated by gen_all_formats.py", + "sha256": "2b28ce1eca1f39623122fbdd853945d05c73adc47e132c250e6ccb56217d689b", + "witnesses": 0 + }, + { + "id": "unum_ii", + "file": "unum_ii_conformance_v0.json", + "kind": "structural", + "n_vectors": 0, + "source": "generated by gen_all_formats.py", + "sha256": "a79c4cdca84fc702a4ce25fd36040912f841dc9d75f35476e78dbbdfc6fb12f8", + "witnesses": 0 + }, + { + "id": "vax_d", + "file": "vax_d_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "b87494ddee38fe68f77dd8082e8a9811530cc346526b80e59c81b17665677792", + "witnesses": 0 + }, + { + "id": "vax_f", + "file": "vax_f_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "a7f45aec8da42931da5ad9f24c3ee369419ec58a783abe657a275210ae9b1e4d", + "witnesses": 0 + }, + { + "id": "vax_g", + "file": "vax_g_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "9a6372bbf85a50457e0b66db8849845333582e3fef28934047963e89dd95e65a", + "witnesses": 0 + }, + { + "id": "vax_h", + "file": "vax_h_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "eaaa44e4ce2e5454da2cc83571bf3261a84a1b6fabb0dc8064c04cd71fa581f0", + "witnesses": 0 + }, + { + "id": "x87_fp80", + "file": "x87_fp80_conformance_v0.json", + "kind": "bitexact", + "n_vectors": 8, + "source": "generated by gen_all_formats.py", + "sha256": "e9be37c939c7108081bd2190e949f4d01be7ad12511d82bb8849f337c94e7e0c", + "witnesses": 0 + } + ] +} diff --git a/conformance/vectors/gft1024_conformance_v0.json b/conformance/vectors/gft1024_conformance_v0.json new file mode 100644 index 000000000..d462531a1 --- /dev/null +++ b/conformance/vectors/gft1024_conformance_v0.json @@ -0,0 +1,262 @@ +{ + "schema": "t27-conformance/v0.1", + "format": "GF-T1024", + "ssot": "specs/numeric/gft1024.t27", + "anchor_identity": "phi^2 + 1/phi^2 = 3", + "anchor_check": { + "value": 3.0, + "expected": 3.0, + "ieee754_exact": true + }, + "exp_trits": 11, + "mant_bits": 1012, + "exp_offset": 88573, + "offset_max": 177146, + "width_rule": "1 + 11 + 1012 = 1024", + "note": "probes are exactly representable in both the rung and f64 (powers of two and 1.5*2^e within range), so every abs_error is exactly zero by construction", + "n_vectors": 22, + "vectors": [ + { + "name": "pos_zero", + "input_f64": 0.0, + "input_f64_hex": "0x0000000000000000", + "gft1024_bits_int": 0, + "gft1024_bits_hex": "0x0", + "decoded_f64": 0.0, + "decoded_f64_hex": "0x0000000000000000", + "abs_error": 0.0, + "category": "zero" + }, + { + "name": "pow2_-1000", + "input_f64": 9.332636185032189e-302, + "input_f64_hex": "0x0170000000000000", + "gft1024_bits_int": 3843490744611757592470176842601739819265798290452016931007346801080596586502718712016767452283983191400769466016107795534729784283297096406632355479343424681185123957738219028833401923129864306719449422207749074754507658619330200663895261921238247959010276921919256810489965861467403368155113930628462446379008, + "gft1024_bits_hex": "0x156150000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 9.332636185032189e-302, + "decoded_f64_hex": "0x0170000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_-1000", + "input_f64": -9.332636185032189e-302, + "input_f64_hex": "0x8170000000000000", + "gft1024_bits_int": 15348726807730579401937730063651498114420850955682778996506871995175487838054780352510110000918065496752456754327876970424892329487419760246174591040269768641362269136929610086516743977609614330364446731141189443960149302289247825078225700995851191137464709605732779897846589601530105211664576735724412791160832, + "gft1024_bits_hex": "0x556150000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": -9.332636185032189e-302, + "decoded_f64_hex": "0x8170000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e-1000", + "input_f64": 1.3998954277548283e-301, + "input_f64_hex": "0x0178000000000000", + "gft1024_bits_int": 3843512689108032767224909866346744568102878588022560660335627249088550411292245750708556112986781336851943919155009147023176764116032547385223968375758297663866322415733021868858460065490655474455547988257914124193688424995145916296571223092272249524835125963729643112528325230027698592729858173225670652461056, + "gft1024_bits_hex": "0x156158000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 1.3998954277548283e-301, + "decoded_f64_hex": "0x0178000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_-500", + "input_f64": 3.054936363499605e-151, + "input_f64_hex": "0x20b0000000000000", + "gft1024_bits_int": 3865435240886932347203200587606488656346095860995746259287794809034421376029757403805428155082128642575222604917459283981709617018748074998245251894216407362383581952541059053891544283921032042818015472372798513935274034435045833339856432955239813783859318732305558848849334421762627942899356527836668528427008, + "gft1024_bits_hex": "0x158090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 3.054936363499605e-151, + "decoded_f64_hex": "0x20b0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_-500", + "input_f64": -3.054936363499605e-151, + "input_f64_hex": "0xa0b0000000000000", + "gft1024_bits_int": 15370671304005754156670753808656246951501148526226508324787320003129312627581819044298770703716210947926909893229228458871872162222870738837787487455142751322560727131732450111574886338400782066463012781306238883140915678104963457754186872029852756962313751416119081936205958161825329786408819332932618873208832, + "gft1024_bits_hex": "0x558090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": -3.054936363499605e-151, + "decoded_f64_hex": "0xa0b0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e-500", + "input_f64": 4.582404545249407e-151, + "input_f64_hex": "0x20b8000000000000", + "gft1024_bits_int": 3865457185383207521957933611351493405183176158566289988616075257042375200819284442497216815784926788026397058056360635470156596851483525976836864790631280345064780410535861893916602426281823210554114038422963563374454800810861548972532394126273815349684167774115945150887693790322923167474100770433876734509056, + "gft1024_bits_hex": "0x158098000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 4.582404545249407e-151, + "decoded_f64_hex": "0x20b8000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_-1", + "input_f64": 0.5, + "input_f64_hex": "0x3fe0000000000000", + "gft1024_bits_int": 3887335848169556752426758285121227995752232836398388128911681920972338515977742018210511536474677802847326837541008069451795490088728151632674922516259644078219643031354293398899570359990617443444384390437517854237678877499130034750465681647173376477058662459071088283131984244937262068494110639850458198310912, + "gft1024_bits_hex": "0x159fc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 0.5, + "decoded_f64_hex": "0x3fe0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_-1", + "input_f64": -0.5, + "input_f64_hex": "0xbfe0000000000000", + "gft1024_bits_int": 15392571911288378561894311506170986290907285501629150194411207115067229767529803658703854085108760108199014125852777244341958035292850815472217158077185988038396788210545684456582912414470367467089381699370958223443320521169047659164796120721786319655513095142884611370488607984999963912003573444946408543092736, + "gft1024_bits_hex": "0x559fc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": -0.5, + "decoded_f64_hex": "0xbfe0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e-1", + "input_f64": 0.75, + "input_f64_hex": "0x3fe8000000000000", + "gft1024_bits_int": 3887357792665831927181491308866232744589313133968931858239962368980292340767269056902300197177475948298501290679909420940242469921463602611266535412674517060900841489349096238924628502351408611180482956487682903676859643874945750383141642818207378042883511500881474585170343613497557293068854882447666404392960, + "gft1024_bits_hex": "0x159fc8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 0.75, + "decoded_f64_hex": "0x3fe8000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_0", + "input_f64": 1.0, + "input_f64_hex": "0x3ff0000000000000", + "gft1024_bits_int": 3887379737162107101936224332611237493426393431539475587568242816988246165556796095594088857880274093749675743818810772428689449754199053589858148309089390043582039947343899078949686644712199778916581522537847953116040410250761466015817603989241379608708360542691860887208702982057852517643599125044874610475008, + "gft1024_bits_hex": "0x159fd0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 1.0, + "decoded_f64_hex": "0x3ff0000000000000", + "abs_error": 0.0, + "category": "unity" + }, + { + "name": "neg_pow2_0", + "input_f64": -1.0, + "input_f64_hex": "0xbff0000000000000", + "gft1024_bits_int": 15392615800280928911403777553660995788581446096770237653067768011083137417108857736087431406514356399101363032130579947318851994958321717429400383870015734003759185126535290136633028699191949802561578831471288322321682053920679090430148043063854322787162793226505383974565326722120554361153061930140824955256832, + "gft1024_bits_hex": "0x559fd0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": -1.0, + "decoded_f64_hex": "0xbff0000000000000", + "abs_error": 0.0, + "category": "unity" + }, + { + "name": "onehalf_2e0", + "input_f64": 1.5, + "input_f64_hex": "0x3ff8000000000000", + "gft1024_bits_int": 3887401681658382276690957356356242242263473729110019316896523264996199990346323134285877518583072239200850196957712123917136429586934504568449761205504263026263238405338701918974744787072990946652680088588013002555221176626577181648493565160275381174533209584502247189247062350618147742218343367642082816557056, + "gft1024_bits_hex": "0x159fd8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 1.5, + "decoded_f64_hex": "0x3ff8000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_1", + "input_f64": 2.0, + "input_f64_hex": "0x4000000000000000", + "gft1024_bits_int": 3887423626154657451445690380101246991100554026680563046224803713004153815135850172977666179285870384652024650096613475405583409419669955547041374101919136008944436863333504758999802929433782114388778654638178051994401943002392897281169526331309382740358058626312633491285421719178442966793087610239291022639104, + "gft1024_bits_hex": "0x159fe0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 2.0, + "decoded_f64_hex": "0x4000000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_1", + "input_f64": -2.0, + "input_f64_hex": "0xc000000000000000", + "gft1024_bits_int": 15392659689273479260913243601151005286255606691911325111724328907099045066687911813471008727919952690003711938408382650295745954623792619386583609662845479969121582042524895816683144983913532138033775963571618421200043586672310521695499965405922325918812491310126156578642045459241144810302550415335241367420928, + "gft1024_bits_hex": "0x559fe0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": -2.0, + "decoded_f64_hex": "0xc000000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e1", + "input_f64": 3.0, + "input_f64_hex": "0x4008000000000000", + "gft1024_bits_int": 3887445570650932626200423403846251739937634324251106775553084161012107639925377211669454839988668530103199103235514826894030389252405406525632986998334008991625635321328307599024861071794573282124877220688343101433582709378208612913845487502343384306182907668123019793323781087738738191367831852836499228721152, + "gft1024_bits_hex": "0x159fe8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 3.0, + "decoded_f64_hex": "0x4008000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_500", + "input_f64": 3.273390607896142e+150, + "input_f64_hex": "0x5f30000000000000", + "gft1024_bits_int": 3909324233437281856669248077615986330506691002083204915848690824942070955083834787382749560678419544924128882720162260875669282489650032181471044723962372724780497942146739104007829005503367515015147572702897392296806786066477098691778775023242945433557402353078162925568071542353077092387841722253080692523008, + "gft1024_bits_hex": "0x15bf10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 3.273390607896142e+150, + "decoded_f64_hex": "0x5f30000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_500", + "input_f64": -3.273390607896142e+150, + "input_f64_hex": "0xdf30000000000000", + "gft1024_bits_int": 15414560296556103666136801298665744625661743667313966981348216019036962206635896427876092109312501850275816171031931435765831827693772696021013280284888716684957643121338130161691171059983117538660144881636337761502448429736394723106109214097855888612011835036891686012924695282415778935897304527349031037304832, + "gft1024_bits_hex": "0x55bf10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": -3.273390607896142e+150, + "decoded_f64_hex": "0xdf30000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e500", + "input_f64": 4.910085911844213e+150, + "input_f64_hex": "0x5f38000000000000", + "gft1024_bits_int": 3909346177933557031423981101360991079343771299653748645176971272950024779873361826074538221381217690375303335859063612364116262322385483160062657620377245707461696400141541944032887147864158682751246138753062441735987552442292814324454736194276946999382251394888549227606430910913372316962585964850288898605056, + "gft1024_bits_hex": "0x15bf18000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 4.910085911844213e+150, + "decoded_f64_hex": "0x5f38000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_1000", + "input_f64": 1.0715086071862673e+301, + "input_f64_hex": "0x7e70000000000000", + "gft1024_bits_int": 3931268729712456611402271822620735167586988572626934244129138832895895744610873479171410263476564996098582021621513749322649115225101010773083941138835355405978955936949579129065971366294535251113713622867946831477573161882192731367739946057244511258406444163464464963927440102648301667132084319461286774571008, + "gft1024_bits_hex": "0x15de50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 1.0715086071862673e+301, + "decoded_f64_hex": "0x7e70000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_1000", + "input_f64": -1.0715086071862673e+301, + "input_f64_hex": "0xfe70000000000000", + "gft1024_bits_int": 15436504792831278420869825043670493462742041237857696309628664026990786996162935119664752812110647301450269309933282924212811660429223674612626176699761699366156101116140970186749313420774285274758710931801387200683214805552110355782070385131857454436860876847277988051284063842711003510641547124557237119352832, + "gft1024_bits_hex": "0x55de50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": -1.0715086071862673e+301, + "decoded_f64_hex": "0xfe70000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e1000", + "input_f64": 1.607262910779401e+301, + "input_f64_hex": "0x7e78000000000000", + "gft1024_bits_int": 3931290674208731786157004846365739916424068870197477973457419280903849569400400517863198924179363141549756474760415100811096095057836461751675554035250228388660154394944381969091029508655326418849812188918111880916753928258008447000415907228278512824231293205274851265965799471208596891706828562058494980653056, + "gft1024_bits_hex": "0x15de58000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 1.607262910779401e+301, + "decoded_f64_hex": "0x7e78000000000000", + "abs_error": 0.0, + "category": "normal" + } + ] +} diff --git a/conformance/vectors/gft128_conformance_v0.json b/conformance/vectors/gft128_conformance_v0.json new file mode 100644 index 000000000..2257928de --- /dev/null +++ b/conformance/vectors/gft128_conformance_v0.json @@ -0,0 +1,262 @@ +{ + "schema": "t27-conformance/v0.1", + "format": "GF-T128", + "ssot": "specs/numeric/gft128.t27", + "anchor_identity": "phi^2 + 1/phi^2 = 3", + "anchor_check": { + "value": 3.0, + "expected": 3.0, + "ieee754_exact": true + }, + "exp_trits": 8, + "mant_bits": 119, + "exp_offset": 3280, + "offset_max": 6560, + "width_rule": "1 + 8 + 119 = 128", + "note": "probes are exactly representable in both the rung and f64 (powers of two and 1.5*2^e within range), so every abs_error is exactly zero by construction", + "n_vectors": 22, + "vectors": [ + { + "name": "pos_zero", + "input_f64": 0.0, + "input_f64_hex": "0x0000000000000000", + "gft128_bits_int": 0, + "gft128_bits_hex": "0x0", + "decoded_f64": 0.0, + "decoded_f64_hex": "0x0000000000000000", + "abs_error": 0.0, + "category": "zero" + }, + { + "name": "pow2_-1000", + "input_f64": 9.332636185032189e-302, + "input_f64_hex": "0x0170000000000000", + "gft128_bits_int": 1515319915194804095110340048719592816640, + "gft128_bits_hex": "0x474000000000000000000000000000000", + "decoded_f64": 9.332636185032189e-302, + "decoded_f64_hex": "0x0170000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_-1000", + "input_f64": -9.332636185032189e-302, + "input_f64_hex": "0x8170000000000000", + "gft128_bits_int": 6959837785929819510524333767627884199936, + "gft128_bits_hex": "0x1474000000000000000000000000000000", + "decoded_f64": -9.332636185032189e-302, + "decoded_f64_hex": "0x8170000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e-1000", + "input_f64": 1.3998954277548283e-301, + "input_f64_hex": "0x0178000000000000", + "gft128_bits_int": 1515652222193750324078566000484662902784, + "gft128_bits_hex": "0x474400000000000000000000000000000", + "decoded_f64": 1.3998954277548283e-301, + "decoded_f64_hex": "0x0178000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_-500", + "input_f64": 3.054936363499605e-151, + "input_f64_hex": "0x20b0000000000000", + "gft128_bits_int": 1847626914141033063336291813789678960640, + "gft128_bits_hex": "0x56e000000000000000000000000000000", + "decoded_f64": 3.054936363499605e-151, + "decoded_f64_hex": "0x20b0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_-500", + "input_f64": -3.054936363499605e-151, + "input_f64_hex": "0xa0b0000000000000", + "gft128_bits_int": 7292144784876048478750285532697970343936, + "gft128_bits_hex": "0x156e000000000000000000000000000000", + "decoded_f64": -3.054936363499605e-151, + "decoded_f64_hex": "0xa0b0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e-500", + "input_f64": 4.582404545249407e-151, + "input_f64_hex": "0x20b8000000000000", + "gft128_bits_int": 1847959221139979292304517765554749046784, + "gft128_bits_hex": "0x56e400000000000000000000000000000", + "decoded_f64": 4.582404545249407e-151, + "decoded_f64_hex": "0x20b8000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_-1", + "input_f64": 0.5, + "input_f64_hex": "0x3fe0000000000000", + "gft128_bits_int": 2179269299089369573625791675329624932352, + "gft128_bits_hex": "0x667800000000000000000000000000000", + "decoded_f64": 0.5, + "decoded_f64_hex": "0x3fe0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_-1", + "input_f64": -0.5, + "input_f64_hex": "0xbfe0000000000000", + "gft128_bits_int": 7623787169824384989039785394237916315648, + "gft128_bits_hex": "0x1667800000000000000000000000000000", + "decoded_f64": -0.5, + "decoded_f64_hex": "0xbfe0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e-1", + "input_f64": 0.75, + "input_f64_hex": "0x3fe8000000000000", + "gft128_bits_int": 2179601606088315802594017627094695018496, + "gft128_bits_hex": "0x667c00000000000000000000000000000", + "decoded_f64": 0.75, + "decoded_f64_hex": "0x3fe8000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_0", + "input_f64": 1.0, + "input_f64_hex": "0x3ff0000000000000", + "gft128_bits_int": 2179933913087262031562243578859765104640, + "gft128_bits_hex": "0x668000000000000000000000000000000", + "decoded_f64": 1.0, + "decoded_f64_hex": "0x3ff0000000000000", + "abs_error": 0.0, + "category": "unity" + }, + { + "name": "neg_pow2_0", + "input_f64": -1.0, + "input_f64_hex": "0xbff0000000000000", + "gft128_bits_int": 7624451783822277446976237297768056487936, + "gft128_bits_hex": "0x1668000000000000000000000000000000", + "decoded_f64": -1.0, + "decoded_f64_hex": "0xbff0000000000000", + "abs_error": 0.0, + "category": "unity" + }, + { + "name": "onehalf_2e0", + "input_f64": 1.5, + "input_f64_hex": "0x3ff8000000000000", + "gft128_bits_int": 2180266220086208260530469530624835190784, + "gft128_bits_hex": "0x668400000000000000000000000000000", + "decoded_f64": 1.5, + "decoded_f64_hex": "0x3ff8000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_1", + "input_f64": 2.0, + "input_f64_hex": "0x4000000000000000", + "gft128_bits_int": 2180598527085154489498695482389905276928, + "gft128_bits_hex": "0x668800000000000000000000000000000", + "decoded_f64": 2.0, + "decoded_f64_hex": "0x4000000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_1", + "input_f64": -2.0, + "input_f64_hex": "0xc000000000000000", + "gft128_bits_int": 7625116397820169904912689201298196660224, + "gft128_bits_hex": "0x1668800000000000000000000000000000", + "decoded_f64": -2.0, + "decoded_f64_hex": "0xc000000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e1", + "input_f64": 3.0, + "input_f64_hex": "0x4008000000000000", + "gft128_bits_int": 2180930834084100718466921434154975363072, + "gft128_bits_hex": "0x668c00000000000000000000000000000", + "decoded_f64": 3.0, + "decoded_f64_hex": "0x4008000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_500", + "input_f64": 3.273390607896142e+150, + "input_f64_hex": "0x5f30000000000000", + "gft128_bits_int": 2512240912033490999788195343929851248640, + "gft128_bits_hex": "0x762000000000000000000000000000000", + "decoded_f64": 3.273390607896142e+150, + "decoded_f64_hex": "0x5f30000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_500", + "input_f64": -3.273390607896142e+150, + "input_f64_hex": "0xdf30000000000000", + "gft128_bits_int": 7956758782768506415202189062838142631936, + "gft128_bits_hex": "0x1762000000000000000000000000000000", + "decoded_f64": -3.273390607896142e+150, + "decoded_f64_hex": "0xdf30000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e500", + "input_f64": 4.910085911844213e+150, + "input_f64_hex": "0x5f38000000000000", + "gft128_bits_int": 2512573219032437228756421295694921334784, + "gft128_bits_hex": "0x762400000000000000000000000000000", + "decoded_f64": 4.910085911844213e+150, + "decoded_f64_hex": "0x5f38000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_1000", + "input_f64": 1.0715086071862673e+301, + "input_f64_hex": "0x7e70000000000000", + "gft128_bits_int": 2844547910979719968014147108999937392640, + "gft128_bits_hex": "0x85c000000000000000000000000000000", + "decoded_f64": 1.0715086071862673e+301, + "decoded_f64_hex": "0x7e70000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_1000", + "input_f64": -1.0715086071862673e+301, + "input_f64_hex": "0xfe70000000000000", + "gft128_bits_int": 8289065781714735383428140827908228775936, + "gft128_bits_hex": "0x185c000000000000000000000000000000", + "decoded_f64": -1.0715086071862673e+301, + "decoded_f64_hex": "0xfe70000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e1000", + "input_f64": 1.607262910779401e+301, + "input_f64_hex": "0x7e78000000000000", + "gft128_bits_int": 2844880217978666196982373060765007478784, + "gft128_bits_hex": "0x85c400000000000000000000000000000", + "decoded_f64": 1.607262910779401e+301, + "decoded_f64_hex": "0x7e78000000000000", + "abs_error": 0.0, + "category": "normal" + } + ] +} diff --git a/conformance/vectors/gft16_conformance_v0.json b/conformance/vectors/gft16_conformance_v0.json new file mode 100644 index 000000000..c20dfb11f --- /dev/null +++ b/conformance/vectors/gft16_conformance_v0.json @@ -0,0 +1,262 @@ +{ + "schema": "t27-conformance/v0.1", + "format": "GF-T16", + "ssot": "specs/numeric/gft16.t27", + "anchor_identity": "phi^2 + 1/phi^2 = 3", + "anchor_check": { + "value": 3.0, + "expected": 3.0, + "ieee754_exact": true + }, + "exp_trits": 4, + "mant_bits": 9, + "exp_offset": 40, + "offset_max": 80, + "width_rule": "1 + 4 + 9 = 14", + "note": "probes are exactly representable in both the rung and f64 (powers of two and 1.5*2^e within range), so every abs_error is exactly zero by construction", + "n_vectors": 22, + "vectors": [ + { + "name": "pos_zero", + "input_f64": 0.0, + "input_f64_hex": "0x0000000000000000", + "gft16_bits_int": 0, + "gft16_bits_hex": "0x0", + "decoded_f64": 0.0, + "decoded_f64_hex": "0x0000000000000000", + "abs_error": 0.0, + "category": "zero" + }, + { + "name": "pow2_-39", + "input_f64": 1.8189894035458565e-12, + "input_f64_hex": "0x3d80000000000000", + "gft16_bits_int": 512, + "gft16_bits_hex": "0x200", + "decoded_f64": 1.8189894035458565e-12, + "decoded_f64_hex": "0x3d80000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_-39", + "input_f64": -1.8189894035458565e-12, + "input_f64_hex": "0xbd80000000000000", + "gft16_bits_int": 66048, + "gft16_bits_hex": "0x10200", + "decoded_f64": -1.8189894035458565e-12, + "decoded_f64_hex": "0xbd80000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e-39", + "input_f64": 2.7284841053187847e-12, + "input_f64_hex": "0x3d88000000000000", + "gft16_bits_int": 768, + "gft16_bits_hex": "0x300", + "decoded_f64": 2.7284841053187847e-12, + "decoded_f64_hex": "0x3d88000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_-19", + "input_f64": 1.9073486328125e-06, + "input_f64_hex": "0x3ec0000000000000", + "gft16_bits_int": 10752, + "gft16_bits_hex": "0x2a00", + "decoded_f64": 1.9073486328125e-06, + "decoded_f64_hex": "0x3ec0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_-19", + "input_f64": -1.9073486328125e-06, + "input_f64_hex": "0xbec0000000000000", + "gft16_bits_int": 76288, + "gft16_bits_hex": "0x12a00", + "decoded_f64": -1.9073486328125e-06, + "decoded_f64_hex": "0xbec0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e-19", + "input_f64": 2.86102294921875e-06, + "input_f64_hex": "0x3ec8000000000000", + "gft16_bits_int": 11008, + "gft16_bits_hex": "0x2b00", + "decoded_f64": 2.86102294921875e-06, + "decoded_f64_hex": "0x3ec8000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_-1", + "input_f64": 0.5, + "input_f64_hex": "0x3fe0000000000000", + "gft16_bits_int": 19968, + "gft16_bits_hex": "0x4e00", + "decoded_f64": 0.5, + "decoded_f64_hex": "0x3fe0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_-1", + "input_f64": -0.5, + "input_f64_hex": "0xbfe0000000000000", + "gft16_bits_int": 85504, + "gft16_bits_hex": "0x14e00", + "decoded_f64": -0.5, + "decoded_f64_hex": "0xbfe0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e-1", + "input_f64": 0.75, + "input_f64_hex": "0x3fe8000000000000", + "gft16_bits_int": 20224, + "gft16_bits_hex": "0x4f00", + "decoded_f64": 0.75, + "decoded_f64_hex": "0x3fe8000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_0", + "input_f64": 1.0, + "input_f64_hex": "0x3ff0000000000000", + "gft16_bits_int": 20480, + "gft16_bits_hex": "0x5000", + "decoded_f64": 1.0, + "decoded_f64_hex": "0x3ff0000000000000", + "abs_error": 0.0, + "category": "unity" + }, + { + "name": "neg_pow2_0", + "input_f64": -1.0, + "input_f64_hex": "0xbff0000000000000", + "gft16_bits_int": 86016, + "gft16_bits_hex": "0x15000", + "decoded_f64": -1.0, + "decoded_f64_hex": "0xbff0000000000000", + "abs_error": 0.0, + "category": "unity" + }, + { + "name": "onehalf_2e0", + "input_f64": 1.5, + "input_f64_hex": "0x3ff8000000000000", + "gft16_bits_int": 20736, + "gft16_bits_hex": "0x5100", + "decoded_f64": 1.5, + "decoded_f64_hex": "0x3ff8000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_1", + "input_f64": 2.0, + "input_f64_hex": "0x4000000000000000", + "gft16_bits_int": 20992, + "gft16_bits_hex": "0x5200", + "decoded_f64": 2.0, + "decoded_f64_hex": "0x4000000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_1", + "input_f64": -2.0, + "input_f64_hex": "0xc000000000000000", + "gft16_bits_int": 86528, + "gft16_bits_hex": "0x15200", + "decoded_f64": -2.0, + "decoded_f64_hex": "0xc000000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e1", + "input_f64": 3.0, + "input_f64_hex": "0x4008000000000000", + "gft16_bits_int": 21248, + "gft16_bits_hex": "0x5300", + "decoded_f64": 3.0, + "decoded_f64_hex": "0x4008000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_19", + "input_f64": 524288.0, + "input_f64_hex": "0x4120000000000000", + "gft16_bits_int": 30208, + "gft16_bits_hex": "0x7600", + "decoded_f64": 524288.0, + "decoded_f64_hex": "0x4120000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_19", + "input_f64": -524288.0, + "input_f64_hex": "0xc120000000000000", + "gft16_bits_int": 95744, + "gft16_bits_hex": "0x17600", + "decoded_f64": -524288.0, + "decoded_f64_hex": "0xc120000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e19", + "input_f64": 786432.0, + "input_f64_hex": "0x4128000000000000", + "gft16_bits_int": 30464, + "gft16_bits_hex": "0x7700", + "decoded_f64": 786432.0, + "decoded_f64_hex": "0x4128000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_39", + "input_f64": 549755813888.0, + "input_f64_hex": "0x4260000000000000", + "gft16_bits_int": 40448, + "gft16_bits_hex": "0x9e00", + "decoded_f64": 549755813888.0, + "decoded_f64_hex": "0x4260000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_39", + "input_f64": -549755813888.0, + "input_f64_hex": "0xc260000000000000", + "gft16_bits_int": 105984, + "gft16_bits_hex": "0x19e00", + "decoded_f64": -549755813888.0, + "decoded_f64_hex": "0xc260000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e39", + "input_f64": 824633720832.0, + "input_f64_hex": "0x4268000000000000", + "gft16_bits_int": 40704, + "gft16_bits_hex": "0x9f00", + "decoded_f64": 824633720832.0, + "decoded_f64_hex": "0x4268000000000000", + "abs_error": 0.0, + "category": "normal" + } + ] +} diff --git a/conformance/vectors/gft256_conformance_v0.json b/conformance/vectors/gft256_conformance_v0.json new file mode 100644 index 000000000..7d9391337 --- /dev/null +++ b/conformance/vectors/gft256_conformance_v0.json @@ -0,0 +1,262 @@ +{ + "schema": "t27-conformance/v0.1", + "format": "GF-T256", + "ssot": "specs/numeric/gft256.t27", + "anchor_identity": "phi^2 + 1/phi^2 = 3", + "anchor_check": { + "value": 3.0, + "expected": 3.0, + "ieee754_exact": true + }, + "exp_trits": 9, + "mant_bits": 246, + "exp_offset": 9841, + "offset_max": 19682, + "width_rule": "1 + 9 + 246 = 256", + "note": "probes are exactly representable in both the rung and f64 (powers of two and 1.5*2^e within range), so every abs_error is exactly zero by construction", + "n_vectors": 22, + "vectors": [ + { + "name": "pos_zero", + "input_f64": 0.0, + "input_f64_hex": "0x0000000000000000", + "gft256_bits_int": 0, + "gft256_bits_hex": "0x0", + "decoded_f64": 0.0, + "decoded_f64_hex": "0x0000000000000000", + "abs_error": 0.0, + "category": "zero" + }, + { + "name": "pow2_-1000", + "input_f64": 9.332636185032189e-302, + "input_f64_hex": "0x0170000000000000", + "gft256_bits_int": 999724473581164534902139725060361126299570248465750221360199707240195292135424, + "gft256_bits_hex": "0x8a240000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 9.332636185032189e-302, + "decoded_f64_hex": "0x0170000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_-1000", + "input_f64": -9.332636185032189e-302, + "input_f64_hex": "0x8170000000000000", + "gft256_bits_int": 4705071329175282788456411245338374177604209757766248270622842395493415440613376, + "gft256_bits_hex": "0x28a240000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": -9.332636185032189e-302, + "decoded_f64_hex": "0x8170000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e-1000", + "input_f64": 1.3998954277548283e-301, + "input_f64_hex": "0x0178000000000000", + "gft256_bits_int": 999781012687237443200686390580384899692076727950450241166859598638636655968256, + "gft256_bits_hex": "0x8a260000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 1.3998954277548283e-301, + "decoded_f64_hex": "0x0178000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_-500", + "input_f64": 3.054936363499605e-151, + "input_f64_hex": "0x20b0000000000000", + "gft256_bits_int": 1056263579654072833448805245084134518806049733165770028020091105681559124967424, + "gft256_bits_hex": "0x91f40000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 3.054936363499605e-151, + "decoded_f64_hex": "0x20b0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_-500", + "input_f64": -3.054936363499605e-151, + "input_f64_hex": "0xa0b0000000000000", + "gft256_bits_int": 4761610435248191087003076765362147570110689242466268077282733793934779273445376, + "gft256_bits_hex": "0x291f40000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": -3.054936363499605e-151, + "decoded_f64_hex": "0xa0b0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e-500", + "input_f64": 4.582404545249407e-151, + "input_f64_hex": "0x20b8000000000000", + "gft256_bits_int": 1056320118760145741747351910604158292198556212650470047826750997080000488800256, + "gft256_bits_hex": "0x91f60000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 4.582404545249407e-151, + "decoded_f64_hex": "0x20b8000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_-1", + "input_f64": 0.5, + "input_f64_hex": "0x3fe0000000000000", + "gft256_bits_int": 1112689607514835315398377434067860364527516258896389795066662721326040230133760, + "gft256_bits_hex": "0x99c00000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 0.5, + "decoded_f64_hex": "0x3fe0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_-1", + "input_f64": -0.5, + "input_f64_hex": "0xbfe0000000000000", + "gft256_bits_int": 4818036463108953568952648954345873415832155768196887844329305409579260378611712, + "gft256_bits_hex": "0x299c00000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": -0.5, + "decoded_f64_hex": "0xbfe0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e-1", + "input_f64": 0.75, + "input_f64_hex": "0x3fe8000000000000", + "gft256_bits_int": 1112746146620908223696924099587884137920022738381089814873322612724481593966592, + "gft256_bits_hex": "0x99c20000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 0.75, + "decoded_f64_hex": "0x3fe8000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_0", + "input_f64": 1.0, + "input_f64_hex": "0x3ff0000000000000", + "gft256_bits_int": 1112802685726981131995470765107907911312529217865789834679982504122922957799424, + "gft256_bits_hex": "0x99c40000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 1.0, + "decoded_f64_hex": "0x3ff0000000000000", + "abs_error": 0.0, + "category": "unity" + }, + { + "name": "neg_pow2_0", + "input_f64": -1.0, + "input_f64_hex": "0xbff0000000000000", + "gft256_bits_int": 4818149541321099385549742285385920962617168727166287883942625192376143106277376, + "gft256_bits_hex": "0x299c40000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": -1.0, + "decoded_f64_hex": "0xbff0000000000000", + "abs_error": 0.0, + "category": "unity" + }, + { + "name": "onehalf_2e0", + "input_f64": 1.5, + "input_f64_hex": "0x3ff8000000000000", + "gft256_bits_int": 1112859224833054040294017430627931684705035697350489854486642395521364321632256, + "gft256_bits_hex": "0x99c60000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 1.5, + "decoded_f64_hex": "0x3ff8000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_1", + "input_f64": 2.0, + "input_f64_hex": "0x4000000000000000", + "gft256_bits_int": 1112915763939126948592564096147955458097542176835189874293302286919805685465088, + "gft256_bits_hex": "0x99c80000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 2.0, + "decoded_f64_hex": "0x4000000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_1", + "input_f64": -2.0, + "input_f64_hex": "0xc000000000000000", + "gft256_bits_int": 4818262619533245202146835616425968509402181686135687923555944975173025833943040, + "gft256_bits_hex": "0x299c80000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": -2.0, + "decoded_f64_hex": "0xc000000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e1", + "input_f64": 3.0, + "input_f64_hex": "0x4008000000000000", + "gft256_bits_int": 1112972303045199856891110761667979231490048656319889894099962178318247049297920, + "gft256_bits_hex": "0x99ca0000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 3.0, + "decoded_f64_hex": "0x4008000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_500", + "input_f64": 3.273390607896142e+150, + "input_f64_hex": "0x5f30000000000000", + "gft256_bits_int": 1169341791799889430542136285131681303819008702565809641339873902564286790631424, + "gft256_bits_hex": "0xa1940000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 3.273390607896142e+150, + "decoded_f64_hex": "0x5f30000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_500", + "input_f64": -3.273390607896142e+150, + "input_f64_hex": "0xdf30000000000000", + "gft256_bits_int": 4874688647394007684096407805409694355123648211866307690602516590817506939109376, + "gft256_bits_hex": "0x2a1940000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": -3.273390607896142e+150, + "decoded_f64_hex": "0xdf30000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e500", + "input_f64": 4.910085911844213e+150, + "input_f64_hex": "0x5f38000000000000", + "gft256_bits_int": 1169398330905962338840682950651705077211515182050509661146533793962728154464256, + "gft256_bits_hex": "0xa1960000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 4.910085911844213e+150, + "decoded_f64_hex": "0x5f38000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_1000", + "input_f64": 1.0715086071862673e+301, + "input_f64_hex": "0x7e70000000000000", + "gft256_bits_int": 1225880897872797729088801805155454696325488187265829447999765301005650623463424, + "gft256_bits_hex": "0xa9640000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 1.0715086071862673e+301, + "decoded_f64_hex": "0x7e70000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_1000", + "input_f64": -1.0715086071862673e+301, + "input_f64_hex": "0xfe70000000000000", + "gft256_bits_int": 4931227753466915982643073325433467747630127696566327497262407989258870771941376, + "gft256_bits_hex": "0x2a9640000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": -1.0715086071862673e+301, + "decoded_f64_hex": "0xfe70000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e1000", + "input_f64": 1.607262910779401e+301, + "input_f64_hex": "0x7e78000000000000", + "gft256_bits_int": 1225937436978870637387348470675478469717994666750529467806425192404091987296256, + "gft256_bits_hex": "0xa9660000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 1.607262910779401e+301, + "decoded_f64_hex": "0x7e78000000000000", + "abs_error": 0.0, + "category": "normal" + } + ] +} diff --git a/conformance/vectors/gft32_conformance_v0.json b/conformance/vectors/gft32_conformance_v0.json new file mode 100644 index 000000000..fb7ac1505 --- /dev/null +++ b/conformance/vectors/gft32_conformance_v0.json @@ -0,0 +1,262 @@ +{ + "schema": "t27-conformance/v0.1", + "format": "GF-T32", + "ssot": "specs/numeric/gft32.t27", + "anchor_identity": "phi^2 + 1/phi^2 = 3", + "anchor_check": { + "value": 3.0, + "expected": 3.0, + "ieee754_exact": true + }, + "exp_trits": 6, + "mant_bits": 25, + "exp_offset": 364, + "offset_max": 728, + "width_rule": "1 + 6 + 25 = 32", + "note": "probes are exactly representable in both the rung and f64 (powers of two and 1.5*2^e within range), so every abs_error is exactly zero by construction", + "n_vectors": 22, + "vectors": [ + { + "name": "pos_zero", + "input_f64": 0.0, + "input_f64_hex": "0x0000000000000000", + "gft32_bits_int": 0, + "gft32_bits_hex": "0x0", + "decoded_f64": 0.0, + "decoded_f64_hex": "0x0000000000000000", + "abs_error": 0.0, + "category": "zero" + }, + { + "name": "pow2_-363", + "input_f64": 5.3224498000101884e-110, + "input_f64_hex": "0x2940000000000000", + "gft32_bits_int": 33554432, + "gft32_bits_hex": "0x2000000", + "decoded_f64": 5.3224498000101884e-110, + "decoded_f64_hex": "0x2940000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_-363", + "input_f64": -5.3224498000101884e-110, + "input_f64_hex": "0xa940000000000000", + "gft32_bits_int": 34393292800, + "gft32_bits_hex": "0x802000000", + "decoded_f64": -5.3224498000101884e-110, + "decoded_f64_hex": "0xa940000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e-363", + "input_f64": 7.983674700015283e-110, + "input_f64_hex": "0x2948000000000000", + "gft32_bits_int": 50331648, + "gft32_bits_hex": "0x3000000", + "decoded_f64": 7.983674700015283e-110, + "decoded_f64_hex": "0x2948000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_-181", + "input_f64": 3.2626522339992623e-55, + "input_f64_hex": "0x34a0000000000000", + "gft32_bits_int": 6140461056, + "gft32_bits_hex": "0x16e000000", + "decoded_f64": 3.2626522339992623e-55, + "decoded_f64_hex": "0x34a0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_-181", + "input_f64": -3.2626522339992623e-55, + "input_f64_hex": "0xb4a0000000000000", + "gft32_bits_int": 40500199424, + "gft32_bits_hex": "0x96e000000", + "decoded_f64": -3.2626522339992623e-55, + "decoded_f64_hex": "0xb4a0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e-181", + "input_f64": 4.8939783509988934e-55, + "input_f64_hex": "0x34a8000000000000", + "gft32_bits_int": 6157238272, + "gft32_bits_hex": "0x16f000000", + "decoded_f64": 4.8939783509988934e-55, + "decoded_f64_hex": "0x34a8000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_-1", + "input_f64": 0.5, + "input_f64_hex": "0x3fe0000000000000", + "gft32_bits_int": 12180258816, + "gft32_bits_hex": "0x2d6000000", + "decoded_f64": 0.5, + "decoded_f64_hex": "0x3fe0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_-1", + "input_f64": -0.5, + "input_f64_hex": "0xbfe0000000000000", + "gft32_bits_int": 46539997184, + "gft32_bits_hex": "0xad6000000", + "decoded_f64": -0.5, + "decoded_f64_hex": "0xbfe0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e-1", + "input_f64": 0.75, + "input_f64_hex": "0x3fe8000000000000", + "gft32_bits_int": 12197036032, + "gft32_bits_hex": "0x2d7000000", + "decoded_f64": 0.75, + "decoded_f64_hex": "0x3fe8000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_0", + "input_f64": 1.0, + "input_f64_hex": "0x3ff0000000000000", + "gft32_bits_int": 12213813248, + "gft32_bits_hex": "0x2d8000000", + "decoded_f64": 1.0, + "decoded_f64_hex": "0x3ff0000000000000", + "abs_error": 0.0, + "category": "unity" + }, + { + "name": "neg_pow2_0", + "input_f64": -1.0, + "input_f64_hex": "0xbff0000000000000", + "gft32_bits_int": 46573551616, + "gft32_bits_hex": "0xad8000000", + "decoded_f64": -1.0, + "decoded_f64_hex": "0xbff0000000000000", + "abs_error": 0.0, + "category": "unity" + }, + { + "name": "onehalf_2e0", + "input_f64": 1.5, + "input_f64_hex": "0x3ff8000000000000", + "gft32_bits_int": 12230590464, + "gft32_bits_hex": "0x2d9000000", + "decoded_f64": 1.5, + "decoded_f64_hex": "0x3ff8000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_1", + "input_f64": 2.0, + "input_f64_hex": "0x4000000000000000", + "gft32_bits_int": 12247367680, + "gft32_bits_hex": "0x2da000000", + "decoded_f64": 2.0, + "decoded_f64_hex": "0x4000000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_1", + "input_f64": -2.0, + "input_f64_hex": "0xc000000000000000", + "gft32_bits_int": 46607106048, + "gft32_bits_hex": "0xada000000", + "decoded_f64": -2.0, + "decoded_f64_hex": "0xc000000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e1", + "input_f64": 3.0, + "input_f64_hex": "0x4008000000000000", + "gft32_bits_int": 12264144896, + "gft32_bits_hex": "0x2db000000", + "decoded_f64": 3.0, + "decoded_f64_hex": "0x4008000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_181", + "input_f64": 3.064991081731778e+54, + "input_f64_hex": "0x4b40000000000000", + "gft32_bits_int": 18287165440, + "gft32_bits_hex": "0x442000000", + "decoded_f64": 3.064991081731778e+54, + "decoded_f64_hex": "0x4b40000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_181", + "input_f64": -3.064991081731778e+54, + "input_f64_hex": "0xcb40000000000000", + "gft32_bits_int": 52646903808, + "gft32_bits_hex": "0xc42000000", + "decoded_f64": -3.064991081731778e+54, + "decoded_f64_hex": "0xcb40000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e181", + "input_f64": 4.5974866225976666e+54, + "input_f64_hex": "0x4b48000000000000", + "gft32_bits_int": 18303942656, + "gft32_bits_hex": "0x443000000", + "decoded_f64": 4.5974866225976666e+54, + "decoded_f64_hex": "0x4b48000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_363", + "input_f64": 1.8788340662190666e+109, + "input_f64_hex": "0x56a0000000000000", + "gft32_bits_int": 24394072064, + "gft32_bits_hex": "0x5ae000000", + "decoded_f64": 1.8788340662190666e+109, + "decoded_f64_hex": "0x56a0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_363", + "input_f64": -1.8788340662190666e+109, + "input_f64_hex": "0xd6a0000000000000", + "gft32_bits_int": 58753810432, + "gft32_bits_hex": "0xdae000000", + "decoded_f64": -1.8788340662190666e+109, + "decoded_f64_hex": "0xd6a0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e363", + "input_f64": 2.8182510993286e+109, + "input_f64_hex": "0x56a8000000000000", + "gft32_bits_int": 24410849280, + "gft32_bits_hex": "0x5af000000", + "decoded_f64": 2.8182510993286e+109, + "decoded_f64_hex": "0x56a8000000000000", + "abs_error": 0.0, + "category": "normal" + } + ] +} diff --git a/conformance/vectors/gft4_conformance_v0.json b/conformance/vectors/gft4_conformance_v0.json new file mode 100644 index 000000000..222ca9cca --- /dev/null +++ b/conformance/vectors/gft4_conformance_v0.json @@ -0,0 +1,196 @@ +{ + "schema": "t27-conformance/v0.1", + "format": "GF-T4", + "ssot": "specs/numeric/gft4.t27", + "anchor_identity": "phi^2 + 1/phi^2 = 3", + "anchor_check": { + "value": 3.0, + "expected": 3.0, + "ieee754_exact": true + }, + "exp_trits": 2, + "mant_bits": 1, + "exp_offset": 4, + "offset_max": 8, + "width_rule": "1 + 2 + 1 = 4", + "note": "probes are exactly representable in both the rung and f64 (powers of two and 1.5*2^e within range), so every abs_error is exactly zero by construction", + "n_vectors": 16, + "vectors": [ + { + "name": "pos_zero", + "input_f64": 0.0, + "input_f64_hex": "0x0000000000000000", + "gft4_bits_int": 0, + "gft4_bits_hex": "0x0", + "decoded_f64": 0.0, + "decoded_f64_hex": "0x0000000000000000", + "abs_error": 0.0, + "category": "zero" + }, + { + "name": "pow2_-3", + "input_f64": 0.125, + "input_f64_hex": "0x3fc0000000000000", + "gft4_bits_int": 2, + "gft4_bits_hex": "0x2", + "decoded_f64": 0.125, + "decoded_f64_hex": "0x3fc0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_-3", + "input_f64": -0.125, + "input_f64_hex": "0xbfc0000000000000", + "gft4_bits_int": 34, + "gft4_bits_hex": "0x22", + "decoded_f64": -0.125, + "decoded_f64_hex": "0xbfc0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e-3", + "input_f64": 0.1875, + "input_f64_hex": "0x3fc8000000000000", + "gft4_bits_int": 3, + "gft4_bits_hex": "0x3", + "decoded_f64": 0.1875, + "decoded_f64_hex": "0x3fc8000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_-1", + "input_f64": 0.5, + "input_f64_hex": "0x3fe0000000000000", + "gft4_bits_int": 6, + "gft4_bits_hex": "0x6", + "decoded_f64": 0.5, + "decoded_f64_hex": "0x3fe0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_-1", + "input_f64": -0.5, + "input_f64_hex": "0xbfe0000000000000", + "gft4_bits_int": 38, + "gft4_bits_hex": "0x26", + "decoded_f64": -0.5, + "decoded_f64_hex": "0xbfe0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e-1", + "input_f64": 0.75, + "input_f64_hex": "0x3fe8000000000000", + "gft4_bits_int": 7, + "gft4_bits_hex": "0x7", + "decoded_f64": 0.75, + "decoded_f64_hex": "0x3fe8000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_0", + "input_f64": 1.0, + "input_f64_hex": "0x3ff0000000000000", + "gft4_bits_int": 8, + "gft4_bits_hex": "0x8", + "decoded_f64": 1.0, + "decoded_f64_hex": "0x3ff0000000000000", + "abs_error": 0.0, + "category": "unity" + }, + { + "name": "neg_pow2_0", + "input_f64": -1.0, + "input_f64_hex": "0xbff0000000000000", + "gft4_bits_int": 40, + "gft4_bits_hex": "0x28", + "decoded_f64": -1.0, + "decoded_f64_hex": "0xbff0000000000000", + "abs_error": 0.0, + "category": "unity" + }, + { + "name": "onehalf_2e0", + "input_f64": 1.5, + "input_f64_hex": "0x3ff8000000000000", + "gft4_bits_int": 9, + "gft4_bits_hex": "0x9", + "decoded_f64": 1.5, + "decoded_f64_hex": "0x3ff8000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_1", + "input_f64": 2.0, + "input_f64_hex": "0x4000000000000000", + "gft4_bits_int": 10, + "gft4_bits_hex": "0xa", + "decoded_f64": 2.0, + "decoded_f64_hex": "0x4000000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_1", + "input_f64": -2.0, + "input_f64_hex": "0xc000000000000000", + "gft4_bits_int": 42, + "gft4_bits_hex": "0x2a", + "decoded_f64": -2.0, + "decoded_f64_hex": "0xc000000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e1", + "input_f64": 3.0, + "input_f64_hex": "0x4008000000000000", + "gft4_bits_int": 11, + "gft4_bits_hex": "0xb", + "decoded_f64": 3.0, + "decoded_f64_hex": "0x4008000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_3", + "input_f64": 8.0, + "input_f64_hex": "0x4020000000000000", + "gft4_bits_int": 14, + "gft4_bits_hex": "0xe", + "decoded_f64": 8.0, + "decoded_f64_hex": "0x4020000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_3", + "input_f64": -8.0, + "input_f64_hex": "0xc020000000000000", + "gft4_bits_int": 46, + "gft4_bits_hex": "0x2e", + "decoded_f64": -8.0, + "decoded_f64_hex": "0xc020000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e3", + "input_f64": 12.0, + "input_f64_hex": "0x4028000000000000", + "gft4_bits_int": 15, + "gft4_bits_hex": "0xf", + "decoded_f64": 12.0, + "decoded_f64_hex": "0x4028000000000000", + "abs_error": 0.0, + "category": "normal" + } + ] +} diff --git a/conformance/vectors/gft512_conformance_v0.json b/conformance/vectors/gft512_conformance_v0.json new file mode 100644 index 000000000..a12dab4bc --- /dev/null +++ b/conformance/vectors/gft512_conformance_v0.json @@ -0,0 +1,262 @@ +{ + "schema": "t27-conformance/v0.1", + "format": "GF-T512", + "ssot": "specs/numeric/gft512.t27", + "anchor_identity": "phi^2 + 1/phi^2 = 3", + "anchor_check": { + "value": 3.0, + "expected": 3.0, + "ieee754_exact": true + }, + "exp_trits": 10, + "mant_bits": 501, + "exp_offset": 29524, + "offset_max": 59048, + "width_rule": "1 + 10 + 501 = 512", + "note": "probes are exactly representable in both the rung and f64 (powers of two and 1.5*2^e within range), so every abs_error is exactly zero by construction", + "n_vectors": 22, + "vectors": [ + { + "name": "pos_zero", + "input_f64": 0.0, + "input_f64_hex": "0x0000000000000000", + "gft512_bits_int": 0, + "gft512_bits_hex": "0x0", + "decoded_f64": 0.0, + "decoded_f64_hex": "0x0000000000000000", + "abs_error": 0.0, + "category": "zero" + }, + { + "name": "pow2_-1000", + "input_f64": 9.332636185032189e-302, + "input_f64_hex": "0x0170000000000000", + "gft512_bits_int": 186740387399259101400512445824620876435654995442664760110442805967148240817293874006980792227008180357143783556109046930933826051429669902906285841918722048, + "gft512_bits_hex": "0xded800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 9.332636185032189e-302, + "decoded_f64_hex": "0x0170000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_-1000", + "input_f64": -9.332636185032189e-302, + "input_f64_hex": "0x8170000000000000", + "gft512_bits_int": 615790241157422208586881245767207952514994701701621348197596772166244689779647377264640769768349090043224803018076600558253950301411960141192162610113413120, + "gft512_bits_hex": "0x2ded800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": -9.332636185032189e-302, + "decoded_f64_hex": "0x8170000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e-1000", + "input_f64": 1.3998954277548283e-301, + "input_f64_hex": "0x0178000000000000", + "gft512_bits_int": 186743660789866997542382459014317704034807212084710803175232289258516336951090278681535675497100506261300934442793174491004835268686215788299339170446311424, + "gft512_bits_hex": "0xded900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 1.3998954277548283e-301, + "decoded_f64_hex": "0x0178000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_-500", + "input_f64": 3.054936363499605e-151, + "input_f64_hex": "0x20b0000000000000", + "gft512_bits_int": 190013778007155243270525635521448475587871637488707824899926097335244374613698548561864062319334084514294670240236607001943043307975555295959614369508098048, + "gft512_bits_hex": "0xe2c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 3.054936363499605e-151, + "decoded_f64_hex": "0x20b0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_-500", + "input_f64": -3.054936363499605e-151, + "input_f64_hex": "0xa0b0000000000000", + "gft512_bits_int": 619063631765318350456894435464035551667211343747664412987080063534340823576052051819524039860674994200375689702204160629263167557957845534245491137702789120, + "gft512_bits_hex": "0x2e2c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": -3.054936363499605e-151, + "decoded_f64_hex": "0xa0b0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e-500", + "input_f64": 4.582404545249407e-151, + "input_f64_hex": "0x20b8000000000000", + "gft512_bits_int": 190017051397763139412395648711145303187023854130753867964715580626612470747494953236418945589426410418451821126920734562014052525232101181352667698035687424, + "gft512_bits_hex": "0xe2c100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 4.582404545249407e-151, + "decoded_f64_hex": "0x20b8000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_-1", + "input_f64": 0.5, + "input_f64_hex": "0x3fe0000000000000", + "gft512_bits_int": 193280621833835592856798798838882419541783846250658803559830422120604316142510413767637565871475336863131255150995911952810242130008348918226836240042295296, + "gft512_bits_hex": "0xe6a600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 0.5, + "decoded_f64_hex": "0x3fe0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_-1", + "input_f64": -0.5, + "input_f64_hex": "0xbfe0000000000000", + "gft512_bits_int": 622330475591998700043167598781469495621123552509615391646984388319700765104863917025297543412816246549212274612963465580130366379990639156512713008236986368, + "gft512_bits_hex": "0x2e6a600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": -0.5, + "decoded_f64_hex": "0xbfe0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e-1", + "input_f64": 0.75, + "input_f64_hex": "0x3fe8000000000000", + "gft512_bits_int": 193283895224443488998668812028579247140936062892704846624619905411972412276306818442192449141567662767288406037680039512881251347264894803619889568569884672, + "gft512_bits_hex": "0xe6a700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 0.75, + "decoded_f64_hex": "0x3fe8000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_0", + "input_f64": 1.0, + "input_f64_hex": "0x3ff0000000000000", + "gft512_bits_int": 193287168615051385140538825218276074740088279534750889689409388703340508410103223116747332411659988671445556924364167072952260564521440689012942897097474048, + "gft512_bits_hex": "0xe6a800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 1.0, + "decoded_f64_hex": "0x3ff0000000000000", + "abs_error": 0.0, + "category": "unity" + }, + { + "name": "neg_pow2_0", + "input_f64": -1.0, + "input_f64_hex": "0xbff0000000000000", + "gft512_bits_int": 622337022373214492326907625160863150819427985793707477776563354902436957372456726374407309953000898357526576386331720700272384814503730927298819665292165120, + "gft512_bits_hex": "0x2e6a800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": -1.0, + "decoded_f64_hex": "0xbff0000000000000", + "abs_error": 0.0, + "category": "unity" + }, + { + "name": "onehalf_2e0", + "input_f64": 1.5, + "input_f64_hex": "0x3ff8000000000000", + "gft512_bits_int": 193290442005659281282408838407972902339240496176796932754198871994708604543899627791302215681752314575602707811048294633023269781777986574405996225625063424, + "gft512_bits_hex": "0xe6a900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 1.5, + "decoded_f64_hex": "0x3ff8000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_1", + "input_f64": 2.0, + "input_f64_hex": "0x4000000000000000", + "gft512_bits_int": 193293715396267177424278851597669729938392712818842975818988355286076700677696032465857098951844640479759858697732422193094278999034532459799049554152652800, + "gft512_bits_hex": "0xe6aa00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 2.0, + "decoded_f64_hex": "0x4000000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_1", + "input_f64": -2.0, + "input_f64_hex": "0xc000000000000000", + "gft512_bits_int": 622343569154430284610647651540256806017732419077799563906142321485173149640049535723517076493185550165840878159699975820414403249016822698084926322347343872, + "gft512_bits_hex": "0x2e6aa00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": -2.0, + "decoded_f64_hex": "0xc000000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e1", + "input_f64": 3.0, + "input_f64_hex": "0x4008000000000000", + "gft512_bits_int": 193296988786875073566148864787366557537544929460889018883777838577444796811492437140411982221936966383917009584416549753165288216291078345192102882680242176, + "gft512_bits_hex": "0xe6ab00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 3.0, + "decoded_f64_hex": "0x4008000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_500", + "input_f64": 3.273390607896142e+150, + "input_f64_hex": "0x5f30000000000000", + "gft512_bits_int": 196560559222947527010552014915103673892304921580793954478892680071436642206507897671630602503985892828596443608491727143961477821067326082066271424686850048, + "gft512_bits_hex": "0xea9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 3.273390607896142e+150, + "decoded_f64_hex": "0x5f30000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_500", + "input_f64": -3.273390607896142e+150, + "input_f64_hex": "0xdf30000000000000", + "gft512_bits_int": 625610412981110634196920814857690749971644627839750542566046646270533091168861400929290580045326802514677463070459280771281602071049616320352148192881541120, + "gft512_bits_hex": "0x2ea9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": -3.273390607896142e+150, + "decoded_f64_hex": "0xdf30000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e500", + "input_f64": 4.910085911844213e+150, + "input_f64_hex": "0x5f38000000000000", + "gft512_bits_int": 196563832613555423152422028104800501491457138222839997543682163362804738340304302346185485774078218732753594495175854704032487038323871967459324753214439424, + "gft512_bits_hex": "0xea9100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 4.910085911844213e+150, + "decoded_f64_hex": "0x5f38000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_1000", + "input_f64": 1.0715086071862673e+301, + "input_f64_hex": "0x7e70000000000000", + "gft512_bits_int": 199833949830843668880565204611931273044521563626837019268375971439532776002912572226513872596311796985747330292619287214970695077613211475119599952276226048, + "gft512_bits_hex": "0xee7800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 1.0715086071862673e+301, + "decoded_f64_hex": "0x7e70000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_1000", + "input_f64": -1.0715086071862673e+301, + "input_f64_hex": "0xfe70000000000000", + "gft512_bits_int": 628883803589006776066934004554518349123861269885793607355529937638629224965266075484173850137652706671828349754586840842290819327595501713405476720470917120, + "gft512_bits_hex": "0x2ee7800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": -1.0715086071862673e+301, + "decoded_f64_hex": "0xfe70000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e1000", + "input_f64": 1.607262910779401e+301, + "input_f64_hex": "0x7e78000000000000", + "gft512_bits_int": 199837223221451565022435217801628100643673780268883062333165454730900872136708976901068755866404122889904481179303414775041704294869757360512653280803815424, + "gft512_bits_hex": "0xee7900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "decoded_f64": 1.607262910779401e+301, + "decoded_f64_hex": "0x7e78000000000000", + "abs_error": 0.0, + "category": "normal" + } + ] +} diff --git a/conformance/vectors/gft64_conformance_v0.json b/conformance/vectors/gft64_conformance_v0.json new file mode 100644 index 000000000..19f720576 --- /dev/null +++ b/conformance/vectors/gft64_conformance_v0.json @@ -0,0 +1,262 @@ +{ + "schema": "t27-conformance/v0.1", + "format": "GF-T64", + "ssot": "specs/numeric/gft64.t27", + "anchor_identity": "phi^2 + 1/phi^2 = 3", + "anchor_check": { + "value": 3.0, + "expected": 3.0, + "ieee754_exact": true + }, + "exp_trits": 7, + "mant_bits": 56, + "exp_offset": 1093, + "offset_max": 2186, + "width_rule": "1 + 7 + 56 = 64", + "note": "probes are exactly representable in both the rung and f64 (powers of two and 1.5*2^e within range), so every abs_error is exactly zero by construction", + "n_vectors": 22, + "vectors": [ + { + "name": "pos_zero", + "input_f64": 0.0, + "input_f64_hex": "0x0000000000000000", + "gft64_bits_int": 0, + "gft64_bits_hex": "0x0", + "decoded_f64": 0.0, + "decoded_f64_hex": "0x0000000000000000", + "abs_error": 0.0, + "category": "zero" + }, + { + "name": "pow2_-1000", + "input_f64": 9.332636185032189e-302, + "input_f64_hex": "0x0170000000000000", + "gft64_bits_int": 6701356245527298048, + "gft64_bits_hex": "0x5d00000000000000", + "decoded_f64": 9.332636185032189e-302, + "decoded_f64_hex": "0x0170000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_-1000", + "input_f64": -9.332636185032189e-302, + "input_f64_hex": "0x8170000000000000", + "gft64_bits_int": 301849261424880123904, + "gft64_bits_hex": "0x105d00000000000000", + "decoded_f64": -9.332636185032189e-302, + "decoded_f64_hex": "0x8170000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e-1000", + "input_f64": 1.3998954277548283e-301, + "input_f64_hex": "0x0178000000000000", + "gft64_bits_int": 6737385042546262016, + "gft64_bits_hex": "0x5d80000000000000", + "decoded_f64": 1.3998954277548283e-301, + "decoded_f64_hex": "0x0178000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_-500", + "input_f64": 3.054936363499605e-151, + "input_f64_hex": "0x20b0000000000000", + "gft64_bits_int": 42730153264491266048, + "gft64_bits_hex": "0x25100000000000000", + "decoded_f64": 3.054936363499605e-151, + "decoded_f64_hex": "0x20b0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_-500", + "input_f64": -3.054936363499605e-151, + "input_f64_hex": "0xa0b0000000000000", + "gft64_bits_int": 337878058443844091904, + "gft64_bits_hex": "0x125100000000000000", + "decoded_f64": -3.054936363499605e-151, + "decoded_f64_hex": "0xa0b0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e-500", + "input_f64": 4.582404545249407e-151, + "input_f64_hex": "0x20b8000000000000", + "gft64_bits_int": 42766182061510230016, + "gft64_bits_hex": "0x25180000000000000", + "decoded_f64": 4.582404545249407e-151, + "decoded_f64_hex": "0x20b8000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_-1", + "input_f64": 0.5, + "input_f64_hex": "0x3fe0000000000000", + "gft64_bits_int": 78686892689417306112, + "gft64_bits_hex": "0x44400000000000000", + "decoded_f64": 0.5, + "decoded_f64_hex": "0x3fe0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_-1", + "input_f64": -0.5, + "input_f64_hex": "0xbfe0000000000000", + "gft64_bits_int": 373834797868770131968, + "gft64_bits_hex": "0x144400000000000000", + "decoded_f64": -0.5, + "decoded_f64_hex": "0xbfe0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e-1", + "input_f64": 0.75, + "input_f64_hex": "0x3fe8000000000000", + "gft64_bits_int": 78722921486436270080, + "gft64_bits_hex": "0x44480000000000000", + "decoded_f64": 0.75, + "decoded_f64_hex": "0x3fe8000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_0", + "input_f64": 1.0, + "input_f64_hex": "0x3ff0000000000000", + "gft64_bits_int": 78758950283455234048, + "gft64_bits_hex": "0x44500000000000000", + "decoded_f64": 1.0, + "decoded_f64_hex": "0x3ff0000000000000", + "abs_error": 0.0, + "category": "unity" + }, + { + "name": "neg_pow2_0", + "input_f64": -1.0, + "input_f64_hex": "0xbff0000000000000", + "gft64_bits_int": 373906855462808059904, + "gft64_bits_hex": "0x144500000000000000", + "decoded_f64": -1.0, + "decoded_f64_hex": "0xbff0000000000000", + "abs_error": 0.0, + "category": "unity" + }, + { + "name": "onehalf_2e0", + "input_f64": 1.5, + "input_f64_hex": "0x3ff8000000000000", + "gft64_bits_int": 78794979080474198016, + "gft64_bits_hex": "0x44580000000000000", + "decoded_f64": 1.5, + "decoded_f64_hex": "0x3ff8000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_1", + "input_f64": 2.0, + "input_f64_hex": "0x4000000000000000", + "gft64_bits_int": 78831007877493161984, + "gft64_bits_hex": "0x44600000000000000", + "decoded_f64": 2.0, + "decoded_f64_hex": "0x4000000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_1", + "input_f64": -2.0, + "input_f64_hex": "0xc000000000000000", + "gft64_bits_int": 373978913056845987840, + "gft64_bits_hex": "0x144600000000000000", + "decoded_f64": -2.0, + "decoded_f64_hex": "0xc000000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e1", + "input_f64": 3.0, + "input_f64_hex": "0x4008000000000000", + "gft64_bits_int": 78867036674512125952, + "gft64_bits_hex": "0x44680000000000000", + "decoded_f64": 3.0, + "decoded_f64_hex": "0x4008000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_500", + "input_f64": 3.273390607896142e+150, + "input_f64_hex": "0x5f30000000000000", + "gft64_bits_int": 114787747302419202048, + "gft64_bits_hex": "0x63900000000000000", + "decoded_f64": 3.273390607896142e+150, + "decoded_f64_hex": "0x5f30000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_500", + "input_f64": -3.273390607896142e+150, + "input_f64_hex": "0xdf30000000000000", + "gft64_bits_int": 409935652481772027904, + "gft64_bits_hex": "0x163900000000000000", + "decoded_f64": -3.273390607896142e+150, + "decoded_f64_hex": "0xdf30000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e500", + "input_f64": 4.910085911844213e+150, + "input_f64_hex": "0x5f38000000000000", + "gft64_bits_int": 114823776099438166016, + "gft64_bits_hex": "0x63980000000000000", + "decoded_f64": 4.910085911844213e+150, + "decoded_f64_hex": "0x5f38000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_1000", + "input_f64": 1.0715086071862673e+301, + "input_f64_hex": "0x7e70000000000000", + "gft64_bits_int": 150816544321383170048, + "gft64_bits_hex": "0x82d00000000000000", + "decoded_f64": 1.0715086071862673e+301, + "decoded_f64_hex": "0x7e70000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_1000", + "input_f64": -1.0715086071862673e+301, + "input_f64_hex": "0xfe70000000000000", + "gft64_bits_int": 445964449500735995904, + "gft64_bits_hex": "0x182d00000000000000", + "decoded_f64": -1.0715086071862673e+301, + "decoded_f64_hex": "0xfe70000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e1000", + "input_f64": 1.607262910779401e+301, + "input_f64_hex": "0x7e78000000000000", + "gft64_bits_int": 150852573118402134016, + "gft64_bits_hex": "0x82d80000000000000", + "decoded_f64": 1.607262910779401e+301, + "decoded_f64_hex": "0x7e78000000000000", + "abs_error": 0.0, + "category": "normal" + } + ] +} diff --git a/conformance/vectors/gft8_conformance_v0.json b/conformance/vectors/gft8_conformance_v0.json new file mode 100644 index 000000000..0dd57414c --- /dev/null +++ b/conformance/vectors/gft8_conformance_v0.json @@ -0,0 +1,262 @@ +{ + "schema": "t27-conformance/v0.1", + "format": "GF-T8", + "ssot": "specs/numeric/gft8.t27", + "anchor_identity": "phi^2 + 1/phi^2 = 3", + "anchor_check": { + "value": 3.0, + "expected": 3.0, + "ieee754_exact": true + }, + "exp_trits": 3, + "mant_bits": 4, + "exp_offset": 13, + "offset_max": 26, + "width_rule": "1 + 3 + 4 = 8", + "note": "probes are exactly representable in both the rung and f64 (powers of two and 1.5*2^e within range), so every abs_error is exactly zero by construction", + "n_vectors": 22, + "vectors": [ + { + "name": "pos_zero", + "input_f64": 0.0, + "input_f64_hex": "0x0000000000000000", + "gft8_bits_int": 0, + "gft8_bits_hex": "0x0", + "decoded_f64": 0.0, + "decoded_f64_hex": "0x0000000000000000", + "abs_error": 0.0, + "category": "zero" + }, + { + "name": "pow2_-12", + "input_f64": 0.000244140625, + "input_f64_hex": "0x3f30000000000000", + "gft8_bits_int": 16, + "gft8_bits_hex": "0x10", + "decoded_f64": 0.000244140625, + "decoded_f64_hex": "0x3f30000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_-12", + "input_f64": -0.000244140625, + "input_f64_hex": "0xbf30000000000000", + "gft8_bits_int": 528, + "gft8_bits_hex": "0x210", + "decoded_f64": -0.000244140625, + "decoded_f64_hex": "0xbf30000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e-12", + "input_f64": 0.0003662109375, + "input_f64_hex": "0x3f38000000000000", + "gft8_bits_int": 24, + "gft8_bits_hex": "0x18", + "decoded_f64": 0.0003662109375, + "decoded_f64_hex": "0x3f38000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_-6", + "input_f64": 0.015625, + "input_f64_hex": "0x3f90000000000000", + "gft8_bits_int": 112, + "gft8_bits_hex": "0x70", + "decoded_f64": 0.015625, + "decoded_f64_hex": "0x3f90000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_-6", + "input_f64": -0.015625, + "input_f64_hex": "0xbf90000000000000", + "gft8_bits_int": 624, + "gft8_bits_hex": "0x270", + "decoded_f64": -0.015625, + "decoded_f64_hex": "0xbf90000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e-6", + "input_f64": 0.0234375, + "input_f64_hex": "0x3f98000000000000", + "gft8_bits_int": 120, + "gft8_bits_hex": "0x78", + "decoded_f64": 0.0234375, + "decoded_f64_hex": "0x3f98000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_-1", + "input_f64": 0.5, + "input_f64_hex": "0x3fe0000000000000", + "gft8_bits_int": 192, + "gft8_bits_hex": "0xc0", + "decoded_f64": 0.5, + "decoded_f64_hex": "0x3fe0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_-1", + "input_f64": -0.5, + "input_f64_hex": "0xbfe0000000000000", + "gft8_bits_int": 704, + "gft8_bits_hex": "0x2c0", + "decoded_f64": -0.5, + "decoded_f64_hex": "0xbfe0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e-1", + "input_f64": 0.75, + "input_f64_hex": "0x3fe8000000000000", + "gft8_bits_int": 200, + "gft8_bits_hex": "0xc8", + "decoded_f64": 0.75, + "decoded_f64_hex": "0x3fe8000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_0", + "input_f64": 1.0, + "input_f64_hex": "0x3ff0000000000000", + "gft8_bits_int": 208, + "gft8_bits_hex": "0xd0", + "decoded_f64": 1.0, + "decoded_f64_hex": "0x3ff0000000000000", + "abs_error": 0.0, + "category": "unity" + }, + { + "name": "neg_pow2_0", + "input_f64": -1.0, + "input_f64_hex": "0xbff0000000000000", + "gft8_bits_int": 720, + "gft8_bits_hex": "0x2d0", + "decoded_f64": -1.0, + "decoded_f64_hex": "0xbff0000000000000", + "abs_error": 0.0, + "category": "unity" + }, + { + "name": "onehalf_2e0", + "input_f64": 1.5, + "input_f64_hex": "0x3ff8000000000000", + "gft8_bits_int": 216, + "gft8_bits_hex": "0xd8", + "decoded_f64": 1.5, + "decoded_f64_hex": "0x3ff8000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_1", + "input_f64": 2.0, + "input_f64_hex": "0x4000000000000000", + "gft8_bits_int": 224, + "gft8_bits_hex": "0xe0", + "decoded_f64": 2.0, + "decoded_f64_hex": "0x4000000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_1", + "input_f64": -2.0, + "input_f64_hex": "0xc000000000000000", + "gft8_bits_int": 736, + "gft8_bits_hex": "0x2e0", + "decoded_f64": -2.0, + "decoded_f64_hex": "0xc000000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e1", + "input_f64": 3.0, + "input_f64_hex": "0x4008000000000000", + "gft8_bits_int": 232, + "gft8_bits_hex": "0xe8", + "decoded_f64": 3.0, + "decoded_f64_hex": "0x4008000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_6", + "input_f64": 64.0, + "input_f64_hex": "0x4050000000000000", + "gft8_bits_int": 304, + "gft8_bits_hex": "0x130", + "decoded_f64": 64.0, + "decoded_f64_hex": "0x4050000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_6", + "input_f64": -64.0, + "input_f64_hex": "0xc050000000000000", + "gft8_bits_int": 816, + "gft8_bits_hex": "0x330", + "decoded_f64": -64.0, + "decoded_f64_hex": "0xc050000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e6", + "input_f64": 96.0, + "input_f64_hex": "0x4058000000000000", + "gft8_bits_int": 312, + "gft8_bits_hex": "0x138", + "decoded_f64": 96.0, + "decoded_f64_hex": "0x4058000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "pow2_12", + "input_f64": 4096.0, + "input_f64_hex": "0x40b0000000000000", + "gft8_bits_int": 400, + "gft8_bits_hex": "0x190", + "decoded_f64": 4096.0, + "decoded_f64_hex": "0x40b0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "neg_pow2_12", + "input_f64": -4096.0, + "input_f64_hex": "0xc0b0000000000000", + "gft8_bits_int": 912, + "gft8_bits_hex": "0x390", + "decoded_f64": -4096.0, + "decoded_f64_hex": "0xc0b0000000000000", + "abs_error": 0.0, + "category": "normal" + }, + { + "name": "onehalf_2e12", + "input_f64": 6144.0, + "input_f64_hex": "0x40b8000000000000", + "gft8_bits_int": 408, + "gft8_bits_hex": "0x198", + "decoded_f64": 6144.0, + "decoded_f64_hex": "0x40b8000000000000", + "abs_error": 0.0, + "category": "normal" + } + ] +} diff --git a/specs/numeric/formats_catalog.t27 b/specs/numeric/formats_catalog.t27 index 69a2d149d..25ad6d3d3 100644 --- a/specs/numeric/formats_catalog.t27 +++ b/specs/numeric/formats_catalog.t27 @@ -269,6 +269,30 @@ module FormatsCatalog { fn gf512() -> str { return "gf512"; } // CATALOG: id=gf1024 name="GF1024 (rule-derived)" bits=1024 s=1 e=391 m=632 bias=2^390-1 phi_distance=0.0006 storage=u1024_software cluster=GoldenFloat status=Open standard="this work; rule e=round(1023/phi^2)=391; lowest phi-distance in the ladder" use_case="OPEN R&D: limit-of-ladder phi alignment (extrapolation, no RTL)" gf_relation=experimental source="specs/numeric/gf1024.t27" + + // --------------------------------------------------------------------- + // GF-T -- the ternary-EXPONENT ladder. Distinct from GFTernary (a 2-bit + // {-phi, 0, +phi} alphabet) and from the binary GF ladder above. + // + // Two fields below need reading with care: + // e= is a count of balanced-ternary TRITS, not bits. The bit-equivalent + // is Et*log2(3) and is given in the standard= string of each row. + // phi_distance= is computed by the catalog's own |e/m - 1/phi| on that + // bit-equivalent. It rises toward 1/phi = 0.618 as N grows, and that + // is structural rather than a defect: GF sizes its exponent by + // e = round((N-1)/phi^2), which puts e/m at 1/phi by construction, + // while GF-T sizes its exponent for RANGE and takes M = N-1-Et. + // The two ladders optimise different axes; the field makes it visible. + // --------------------------------------------------------------------- + // CATALOG: id=gft4 name="GF-T4" bits=4 s=1 e=2 m=1 bias=4 phi_distance=2.552 storage=u4 cluster=GoldenFloat status=Verified standard="this work; e is 2 balanced-ternary TRITS not bits (3.17 bits equivalent); width rule 1+Et+M=N; post-route XC7A200T 12 LUT 161.1 MHz, no DSP, 1 cycle" use_case="fixed-field ternary-exponent ladder; no regime codec" gf_relation=self source="specs/numeric/gft4.t27" + // CATALOG: id=gft8 name="GF-T8" bits=8 s=1 e=3 m=4 bias=13 phi_distance=0.571 storage=u8 cluster=GoldenFloat status=Verified standard="this work; e is 3 balanced-ternary TRITS not bits (4.75 bits equivalent); width rule 1+Et+M=N; post-route XC7A200T 50 LUT 153.2 MHz, no DSP, 1 cycle" use_case="fixed-field ternary-exponent ladder; no regime codec" gf_relation=self source="specs/numeric/gft8.t27" + // CATALOG: id=gft16 name="GF-T16" bits=16 s=1 e=4 m=9 bias=40 phi_distance=0.086 storage=u16 cluster=GoldenFloat status=Verified standard="this work; e is 4 balanced-ternary TRITS not bits (6.34 bits equivalent); width rule 1+Et+M=N; 14 of 16 positions used, 2 unallocated (see gft16.t27 open_issue) post-route XC7A200T 212 LUT 131.7 MHz, no DSP, 1 cycle" use_case="fixed-field ternary-exponent ladder; no regime codec" gf_relation=self source="specs/numeric/gft16.t27" + // CATALOG: id=gft32 name="GF-T32" bits=32 s=1 e=6 m=25 bias=364 phi_distance=0.238 storage=u32 cluster=GoldenFloat status=Verified standard="this work; e is 6 balanced-ternary TRITS not bits (9.51 bits equivalent); width rule 1+Et+M=N; post-route XC7A200T 1477 LUT 83.3 MHz, no DSP, 1 cycle" use_case="fixed-field ternary-exponent ladder; no regime codec" gf_relation=self source="specs/numeric/gft32.t27" + // CATALOG: id=gft64 name="GF-T64" bits=64 s=1 e=7 m=56 bias=1093 phi_distance=0.420 storage=u64 cluster=GoldenFloat status=Verified standard="this work; e is 7 balanced-ternary TRITS not bits (11.09 bits equivalent); width rule 1+Et+M=N; post-route XC7A200T 7479 LUT 48.2 MHz, no DSP, 1 cycle" use_case="fixed-field ternary-exponent ladder; no regime codec" gf_relation=self source="specs/numeric/gft64.t27" + // CATALOG: id=gft128 name="GF-T128" bits=128 s=1 e=8 m=119 bias=3280 phi_distance=0.511 storage=u128 cluster=GoldenFloat status=Open standard="this work; e is 8 balanced-ternary TRITS not bits (12.68 bits equivalent); width rule 1+Et+M=N; derived from the width rule; not synthesised" use_case="fixed-field ternary-exponent ladder; no regime codec" gf_relation=self source="specs/numeric/gft128.t27" + // CATALOG: id=gft256 name="GF-T256" bits=256 s=1 e=9 m=246 bias=9841 phi_distance=0.560 storage=u256_software cluster=GoldenFloat status=Open standard="this work; e is 9 balanced-ternary TRITS not bits (14.26 bits equivalent); width rule 1+Et+M=N; derived from the width rule; not synthesised" use_case="fixed-field ternary-exponent ladder; no regime codec" gf_relation=self source="specs/numeric/gft256.t27" + // CATALOG: id=gft512 name="GF-T512" bits=512 s=1 e=10 m=501 bias=29524 phi_distance=0.586 storage=u512_software cluster=GoldenFloat status=Open standard="this work; e is 10 balanced-ternary TRITS not bits (15.85 bits equivalent); width rule 1+Et+M=N; derived from the width rule; not synthesised" use_case="fixed-field ternary-exponent ladder; no regime codec" gf_relation=self source="specs/numeric/gft512.t27" + // CATALOG: id=gft1024 name="GF-T1024" bits=1024 s=1 e=11 m=1012 bias=88573 phi_distance=0.601 storage=u1024_software cluster=GoldenFloat status=Open standard="this work; e is 11 balanced-ternary TRITS not bits (17.43 bits equivalent); width rule 1+Et+M=N; derived from the width rule; not synthesised" use_case="fixed-field ternary-exponent ladder; no regime codec" gf_relation=self source="specs/numeric/gft1024.t27" fn gf1024() -> str { return "gf1024"; } // GF hybrids / experimental compositions (Section 12.5). diff --git a/specs/numeric/gft1024.t27 b/specs/numeric/gft1024.t27 new file mode 100644 index 000000000..18ffd2b0d --- /dev/null +++ b/specs/numeric/gft1024.t27 @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: Apache-2.0 +// gft1024.t27 -- GF-T1024: ternary-native GoldenFloat, 1024-bit class. +// +// Derived from the ladder's width rule 1 + E_t + M = N, counting one position +// per trit -- the rule GF-T4, GF-T8 and GF-T32 already satisfy exactly. A +// research note (trinity-fpga/research/GF_T_GOLD_STANDARD_LADDER_2026-08-05.md) +// carries a different mantissa width for this rung; it falls short of the +// declared width and is superseded by this file. +// +// layout: [ sign(1) | E = 11 balanced-ternary trits | M = 1012 binary bits ] +// value = (-1)^sign * (1 + M/2^1012) * 2^e, e in [-88573,+88573] (~53326 decades) +// +// Exponent trits are stored as codes 0/1/2 = ternary digit -1/0/+1 shifted to an +// unsigned OFFSET in [0,177146]; balanced exponent e = offset - 88573. +// phi^2 + 1/phi^2 = 3 | TRINITY + +module triformat_gft1024 { + use base::types; + + const SIGN_BITS: u32 = 1; + const EXP_TRITS: u32 = 11; // 3^11 = 177147 exponent values + const MANT_BITS: u32 = 1012; // M = N - 1 - E_t + const EXP_OFFSET: u32 = 88573; // (3^EXP_TRITS - 1) / 2 -- the balanced zero point + const OFFSET_MAX: u32 = 177146; // 3^EXP_TRITS - 1 (reserved special row) + + // Decode the 11-trit exponent field (each 2-bit code in {0,1,2}) into its + // unsigned offset in [0,177146]. + fn exp_offset(t0: u32, t1: u32, t2: u32, t3: u32, t4: u32, t5: u32, t6: u32, t7: u32, t8: u32, t9: u32, t10: u32) -> u32 { + return t0 + (3 * t1) + (9 * t2) + (27 * t3) + (81 * t4) + (243 * t5) + (729 * t6) + (2187 * t7) + (6561 * t8) + (19683 * t9) + (59049 * t10); + } + + fn is_finite(offset: u32) -> bool { + return offset != OFFSET_MAX; + } + + fn exp_values() -> u32 { + return 177147; + } + + // ---- Tests / invariants ---- + + test width_rule { + assert(SIGN_BITS + EXP_TRITS + MANT_BITS == 1024, "1 + E_t + M = N, one position per trit"); + } + + test offset_range { + assert(exp_offset(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) == 0, "min offset (exponent -88573)"); + assert(exp_offset(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2) == 177146, "max offset (reserved special)"); + assert(exp_offset(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) == 88573, "center offset = exponent 0 (unity)"); + } + + test radix3_economy { + assert(exp_values() == 177147, "3^11 exponent values"); + assert(EXP_OFFSET * 2 == OFFSET_MAX, "balanced: offset_max = 2 * exp_offset"); + } + + test finiteness { + assert(is_finite(88573) == true, "unity exponent is finite"); + assert(is_finite(177146) == false, "offset 177146 is the reserved special row"); + } +} diff --git a/specs/numeric/gft128.t27 b/specs/numeric/gft128.t27 new file mode 100644 index 000000000..f4eb61bea --- /dev/null +++ b/specs/numeric/gft128.t27 @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: Apache-2.0 +// gft128.t27 -- GF-T128: ternary-native GoldenFloat, 128-bit class. +// +// Derived from the ladder's width rule 1 + E_t + M = N, counting one position +// per trit -- the rule GF-T4, GF-T8 and GF-T32 already satisfy exactly. A +// research note (trinity-fpga/research/GF_T_GOLD_STANDARD_LADDER_2026-08-05.md) +// carries a different mantissa width for this rung; it falls short of the +// declared width and is superseded by this file. +// +// layout: [ sign(1) | E = 8 balanced-ternary trits | M = 119 binary bits ] +// value = (-1)^sign * (1 + M/2^119) * 2^e, e in [-3280,+3280] (~1975 decades) +// +// Exponent trits are stored as codes 0/1/2 = ternary digit -1/0/+1 shifted to an +// unsigned OFFSET in [0,6560]; balanced exponent e = offset - 3280. +// phi^2 + 1/phi^2 = 3 | TRINITY + +module triformat_gft128 { + use base::types; + + const SIGN_BITS: u32 = 1; + const EXP_TRITS: u32 = 8; // 3^8 = 6561 exponent values + const MANT_BITS: u32 = 119; // M = N - 1 - E_t + const EXP_OFFSET: u32 = 3280; // (3^EXP_TRITS - 1) / 2 -- the balanced zero point + const OFFSET_MAX: u32 = 6560; // 3^EXP_TRITS - 1 (reserved special row) + + // Decode the 8-trit exponent field (each 2-bit code in {0,1,2}) into its + // unsigned offset in [0,6560]. + fn exp_offset(t0: u32, t1: u32, t2: u32, t3: u32, t4: u32, t5: u32, t6: u32, t7: u32) -> u32 { + return t0 + (3 * t1) + (9 * t2) + (27 * t3) + (81 * t4) + (243 * t5) + (729 * t6) + (2187 * t7); + } + + fn is_finite(offset: u32) -> bool { + return offset != OFFSET_MAX; + } + + fn exp_values() -> u32 { + return 6561; + } + + // ---- Tests / invariants ---- + + test width_rule { + assert(SIGN_BITS + EXP_TRITS + MANT_BITS == 128, "1 + E_t + M = N, one position per trit"); + } + + test offset_range { + assert(exp_offset(0, 0, 0, 0, 0, 0, 0, 0) == 0, "min offset (exponent -3280)"); + assert(exp_offset(2, 2, 2, 2, 2, 2, 2, 2) == 6560, "max offset (reserved special)"); + assert(exp_offset(1, 1, 1, 1, 1, 1, 1, 1) == 3280, "center offset = exponent 0 (unity)"); + } + + test radix3_economy { + assert(exp_values() == 6561, "3^8 exponent values"); + assert(EXP_OFFSET * 2 == OFFSET_MAX, "balanced: offset_max = 2 * exp_offset"); + } + + test finiteness { + assert(is_finite(3280) == true, "unity exponent is finite"); + assert(is_finite(6560) == false, "offset 6560 is the reserved special row"); + } +} diff --git a/specs/numeric/gft256.t27 b/specs/numeric/gft256.t27 new file mode 100644 index 000000000..805b43da5 --- /dev/null +++ b/specs/numeric/gft256.t27 @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: Apache-2.0 +// gft256.t27 -- GF-T256: ternary-native GoldenFloat, 256-bit class. +// +// Derived from the ladder's width rule 1 + E_t + M = N, counting one position +// per trit -- the rule GF-T4, GF-T8 and GF-T32 already satisfy exactly. A +// research note (trinity-fpga/research/GF_T_GOLD_STANDARD_LADDER_2026-08-05.md) +// carries a different mantissa width for this rung; it falls short of the +// declared width and is superseded by this file. +// +// layout: [ sign(1) | E = 9 balanced-ternary trits | M = 246 binary bits ] +// value = (-1)^sign * (1 + M/2^246) * 2^e, e in [-9841,+9841] (~5925 decades) +// +// Exponent trits are stored as codes 0/1/2 = ternary digit -1/0/+1 shifted to an +// unsigned OFFSET in [0,19682]; balanced exponent e = offset - 9841. +// phi^2 + 1/phi^2 = 3 | TRINITY + +module triformat_gft256 { + use base::types; + + const SIGN_BITS: u32 = 1; + const EXP_TRITS: u32 = 9; // 3^9 = 19683 exponent values + const MANT_BITS: u32 = 246; // M = N - 1 - E_t + const EXP_OFFSET: u32 = 9841; // (3^EXP_TRITS - 1) / 2 -- the balanced zero point + const OFFSET_MAX: u32 = 19682; // 3^EXP_TRITS - 1 (reserved special row) + + // Decode the 9-trit exponent field (each 2-bit code in {0,1,2}) into its + // unsigned offset in [0,19682]. + fn exp_offset(t0: u32, t1: u32, t2: u32, t3: u32, t4: u32, t5: u32, t6: u32, t7: u32, t8: u32) -> u32 { + return t0 + (3 * t1) + (9 * t2) + (27 * t3) + (81 * t4) + (243 * t5) + (729 * t6) + (2187 * t7) + (6561 * t8); + } + + fn is_finite(offset: u32) -> bool { + return offset != OFFSET_MAX; + } + + fn exp_values() -> u32 { + return 19683; + } + + // ---- Tests / invariants ---- + + test width_rule { + assert(SIGN_BITS + EXP_TRITS + MANT_BITS == 256, "1 + E_t + M = N, one position per trit"); + } + + test offset_range { + assert(exp_offset(0, 0, 0, 0, 0, 0, 0, 0, 0) == 0, "min offset (exponent -9841)"); + assert(exp_offset(2, 2, 2, 2, 2, 2, 2, 2, 2) == 19682, "max offset (reserved special)"); + assert(exp_offset(1, 1, 1, 1, 1, 1, 1, 1, 1) == 9841, "center offset = exponent 0 (unity)"); + } + + test radix3_economy { + assert(exp_values() == 19683, "3^9 exponent values"); + assert(EXP_OFFSET * 2 == OFFSET_MAX, "balanced: offset_max = 2 * exp_offset"); + } + + test finiteness { + assert(is_finite(9841) == true, "unity exponent is finite"); + assert(is_finite(19682) == false, "offset 19682 is the reserved special row"); + } +} diff --git a/specs/numeric/gft512.t27 b/specs/numeric/gft512.t27 new file mode 100644 index 000000000..2f7b0eed8 --- /dev/null +++ b/specs/numeric/gft512.t27 @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: Apache-2.0 +// gft512.t27 -- GF-T512: ternary-native GoldenFloat, 512-bit class. +// +// Derived from the ladder's width rule 1 + E_t + M = N, counting one position +// per trit -- the rule GF-T4, GF-T8 and GF-T32 already satisfy exactly. A +// research note (trinity-fpga/research/GF_T_GOLD_STANDARD_LADDER_2026-08-05.md) +// carries a different mantissa width for this rung; it falls short of the +// declared width and is superseded by this file. +// +// layout: [ sign(1) | E = 10 balanced-ternary trits | M = 501 binary bits ] +// value = (-1)^sign * (1 + M/2^501) * 2^e, e in [-29524,+29524] (~17775 decades) +// +// Exponent trits are stored as codes 0/1/2 = ternary digit -1/0/+1 shifted to an +// unsigned OFFSET in [0,59048]; balanced exponent e = offset - 29524. +// phi^2 + 1/phi^2 = 3 | TRINITY + +module triformat_gft512 { + use base::types; + + const SIGN_BITS: u32 = 1; + const EXP_TRITS: u32 = 10; // 3^10 = 59049 exponent values + const MANT_BITS: u32 = 501; // M = N - 1 - E_t + const EXP_OFFSET: u32 = 29524; // (3^EXP_TRITS - 1) / 2 -- the balanced zero point + const OFFSET_MAX: u32 = 59048; // 3^EXP_TRITS - 1 (reserved special row) + + // Decode the 10-trit exponent field (each 2-bit code in {0,1,2}) into its + // unsigned offset in [0,59048]. + fn exp_offset(t0: u32, t1: u32, t2: u32, t3: u32, t4: u32, t5: u32, t6: u32, t7: u32, t8: u32, t9: u32) -> u32 { + return t0 + (3 * t1) + (9 * t2) + (27 * t3) + (81 * t4) + (243 * t5) + (729 * t6) + (2187 * t7) + (6561 * t8) + (19683 * t9); + } + + fn is_finite(offset: u32) -> bool { + return offset != OFFSET_MAX; + } + + fn exp_values() -> u32 { + return 59049; + } + + // ---- Tests / invariants ---- + + test width_rule { + assert(SIGN_BITS + EXP_TRITS + MANT_BITS == 512, "1 + E_t + M = N, one position per trit"); + } + + test offset_range { + assert(exp_offset(0, 0, 0, 0, 0, 0, 0, 0, 0, 0) == 0, "min offset (exponent -29524)"); + assert(exp_offset(2, 2, 2, 2, 2, 2, 2, 2, 2, 2) == 59048, "max offset (reserved special)"); + assert(exp_offset(1, 1, 1, 1, 1, 1, 1, 1, 1, 1) == 29524, "center offset = exponent 0 (unity)"); + } + + test radix3_economy { + assert(exp_values() == 59049, "3^10 exponent values"); + assert(EXP_OFFSET * 2 == OFFSET_MAX, "balanced: offset_max = 2 * exp_offset"); + } + + test finiteness { + assert(is_finite(29524) == true, "unity exponent is finite"); + assert(is_finite(59048) == false, "offset 59048 is the reserved special row"); + } +} diff --git a/specs/numeric/gft64.t27 b/specs/numeric/gft64.t27 new file mode 100644 index 000000000..c101761aa --- /dev/null +++ b/specs/numeric/gft64.t27 @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: Apache-2.0 +// gft64.t27 -- GF-T64: ternary-native GoldenFloat, 64-bit class. +// +// Derived from the ladder's width rule 1 + E_t + M = N, counting one position +// per trit -- the rule GF-T4, GF-T8 and GF-T32 already satisfy exactly. A +// research note (trinity-fpga/research/GF_T_GOLD_STANDARD_LADDER_2026-08-05.md) +// carries a different mantissa width for this rung; it falls short of the +// declared width and is superseded by this file. +// +// layout: [ sign(1) | E = 7 balanced-ternary trits | M = 56 binary bits ] +// value = (-1)^sign * (1 + M/2^56) * 2^e, e in [-1093,+1093] (~658 decades) +// +// Exponent trits are stored as codes 0/1/2 = ternary digit -1/0/+1 shifted to an +// unsigned OFFSET in [0,2186]; balanced exponent e = offset - 1093. +// phi^2 + 1/phi^2 = 3 | TRINITY + +module triformat_gft64 { + use base::types; + + const SIGN_BITS: u32 = 1; + const EXP_TRITS: u32 = 7; // 3^7 = 2187 exponent values + const MANT_BITS: u32 = 56; // M = N - 1 - E_t + const EXP_OFFSET: u32 = 1093; // (3^EXP_TRITS - 1) / 2 -- the balanced zero point + const OFFSET_MAX: u32 = 2186; // 3^EXP_TRITS - 1 (reserved special row) + + // Decode the 7-trit exponent field (each 2-bit code in {0,1,2}) into its + // unsigned offset in [0,2186]. + fn exp_offset(t0: u32, t1: u32, t2: u32, t3: u32, t4: u32, t5: u32, t6: u32) -> u32 { + return t0 + (3 * t1) + (9 * t2) + (27 * t3) + (81 * t4) + (243 * t5) + (729 * t6); + } + + fn is_finite(offset: u32) -> bool { + return offset != OFFSET_MAX; + } + + fn exp_values() -> u32 { + return 2187; + } + + // ---- Tests / invariants ---- + + test width_rule { + assert(SIGN_BITS + EXP_TRITS + MANT_BITS == 64, "1 + E_t + M = N, one position per trit"); + } + + test offset_range { + assert(exp_offset(0, 0, 0, 0, 0, 0, 0) == 0, "min offset (exponent -1093)"); + assert(exp_offset(2, 2, 2, 2, 2, 2, 2) == 2186, "max offset (reserved special)"); + assert(exp_offset(1, 1, 1, 1, 1, 1, 1) == 1093, "center offset = exponent 0 (unity)"); + } + + test radix3_economy { + assert(exp_values() == 2187, "3^7 exponent values"); + assert(EXP_OFFSET * 2 == OFFSET_MAX, "balanced: offset_max = 2 * exp_offset"); + } + + test finiteness { + assert(is_finite(1093) == true, "unity exponent is finite"); + assert(is_finite(2186) == false, "offset 2186 is the reserved special row"); + } +} From 951b0d1202f71252038fd4790356a591239de04a Mon Sep 17 00:00:00 2001 From: Dmitrii Vasilev Date: Sun, 9 Aug 2026 01:17:28 +0700 Subject: [PATCH 2/5] docs(numeric): give GF-T a section in the human-readable SSOT The catalog now carries all nine GF-T rows but NUMERIC_FORMATS_SSOT.md still described only the binary GF ladder, TF3 and GFTernary. Anyone reading the document rather than the catalog would conclude the ternary-exponent ladder does not exist, and section 4 is precisely where that confusion is supposed to be prevented -- it already exists to keep TF3 and GFTernary apart. Section 4a adds the third object. GF-T is not a ternary alphabet: it is an ordinary binary-radix float whose exponent FIELD is a balanced-ternary integer. Only the encoding is ternary; the scale is a power of two. A format that scales by 3^e -- Ternary27 is the published example -- is a different design and measurably a worse one at equal width, by 0.33 positions per number, and the section gives the closed form. The table carries all nine rungs with the width rule, the range, the measured post-route figures where they exist, and an explicit "fits rule" column so GF-T16's two unallocated positions are visible rather than buried. Two columns are read wrong without help, so the section explains both. E is a count of trits; the bit-equivalent is given. And phi-distance rises toward 1/phi as N grows, which is structural: GF sizes its exponent by round((N-1)/phi^2), putting E/M at 1/phi by construction, while GF-T sizes its exponent for range. Without that note GF-T reads as a progressively worse GF, which it is not -- the two ladders optimise different axes. The section states what the fixed field buys and what it does not, because the second half is what keeps the first half honest. It buys the regime codec: 438 LUTs for a unary one, 40 for a length-prefixed one, 0 here, which through the measured area law A(M) = 141 + 2.4455 M^2 is 9.95 mantissa bits of silicon at the 16-bit class and 1.00 at M = 90. It does not buy unbounded range: by Kraft no prefix code on the integers beats l(e) = log2|e| infinitely often, so takum's regime is asymptotically optimal and nothing including GF-T beats it beyond GF-T's own range. The 2.83x and 5.46x hold inside that range and are marked as such. Co-Authored-By: Claude Opus 5 --- docs/NUMERIC_FORMATS_SSOT.md | 66 ++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/docs/NUMERIC_FORMATS_SSOT.md b/docs/NUMERIC_FORMATS_SSOT.md index 8daf99d15..a0fea2216 100644 --- a/docs/NUMERIC_FORMATS_SSOT.md +++ b/docs/NUMERIC_FORMATS_SSOT.md @@ -145,6 +145,72 @@ Two **distinct** objects — do not conflate (the spec is authoritative): - **Candidates (no normative spec):** GF6 (φ-gap fill 4↔8), GF128 (binary128-range φ). NOT CLAIMED. + +### 4a. GF-T — the ternary-EXPONENT ladder (distinct from both of the above) + +A **third** ternary object, and the one most often confused with GFTernary. GF-T +is not a ternary alphabet: it is an ordinary binary-radix float whose **exponent +field is a balanced-ternary integer** of `E_t` trits, with a constant `M`-bit +mantissa and fixed fields. + + value = (-1)^s * (1 + M/2^m) * 2^e, e = sum_i t_i * 3^i + +The scale is a power of **two**; only the exponent's *encoding* is ternary. A +format that scales by `3^e` — Ternary27 is the published example — is a different +design, and measurably a worse one at equal width: with the significand +quantised over `[1,r)` the mean relative error is `kappa(r) * 2^-M` with +`kappa(r) = (r-1)^2 / (r ln r)`, so radix 3 costs 0.75 positions of precision and +buys 0.42 of range, a net loss of 0.33 positions per number. + +**Width rule:** `1 + E_t + M = N`, counting one position per trit. Eight of the +nine rungs satisfy it exactly. GF-T16 does not — it inherits GF16's phi-optimal +`M = 9` and replaces GF16's six-bit exponent with four trits, leaving two +positions unallocated. Spending them as `M = 11` divides the error by 4.00 at +unchanged range for 19% more LUTs and no loss of frequency (measured, XC7A200T). +Not changed, because it invalidates the conformance vectors and the published +silicon numbers; recorded here and in the rung's `open_issue` field so the +decision stays explicit. + +| Format | S+E+M | Bits | \|e\| max | Decades | E_t bits-equiv | φ-distance | Fits rule | Post-route XC7A200T | Spec | +|---|---|---|---|---|---|---|---|---|---| +| GF-T4 | 1+2t+1 | 4 | 4 | 2 | 3.17 | 2.552 | **yes** | 12 LUT / 161.1 MHz | [`gft4.t27`](../specs/numeric/gft4.t27) | +| GF-T8 | 1+3t+4 | 8 | 13 | 8 | 4.75 | 0.571 | **yes** | 50 / 153.2 | [`gft8.t27`](../specs/numeric/gft8.t27) | +| GF-T16 | 1+4t+9 | 16 | 40 | 24 | 6.34 | 0.086 | **no (2 unallocated)** | 212 / 131.7 | [`gft16.t27`](../specs/numeric/gft16.t27) | +| GF-T32 | 1+6t+25 | 32 | 364 | 219 | 9.51 | 0.238 | **yes** | 1477 / 83.3 | [`gft32.t27`](../specs/numeric/gft32.t27) | +| GF-T64 | 1+7t+56 | 64 | 1093 | 658 | 11.09 | 0.420 | **yes** | 7479 / 48.2 | [`gft64.t27`](../specs/numeric/gft64.t27) | +| GF-T128 | 1+8t+119 | 128 | 3280 | 1975 | 12.68 | 0.511 | **yes** | — | [`gft128.t27`](../specs/numeric/gft128.t27) | +| GF-T256 | 1+9t+246 | 256 | 9841 | 5925 | 14.26 | 0.560 | **yes** | — | [`gft256.t27`](../specs/numeric/gft256.t27) | +| GF-T512 | 1+10t+501 | 512 | 29524 | 17775 | 15.85 | 0.586 | **yes** | — | [`gft512.t27`](../specs/numeric/gft512.t27) | +| GF-T1024 | 1+11t+1012 | 1024 | 88573 | 53326 | 17.43 | 0.601 | **yes** | — | [`gft1024.t27`](../specs/numeric/gft1024.t27) | + +**Reading the φ-distance column.** It is the catalog's own `|E/M - 1/φ|` computed +on the exponent's bit-equivalent `E_t*log2(3)`, and it **rises toward 1/φ as N +grows**. That is structural rather than a defect. GF sizes its exponent by +`e = round((N-1)/φ²)`, which puts `E/M` at `1/φ` by construction; GF-T sizes its +exponent for **range** and takes `M = N-1-E_t`. The two ladders optimise different +axes, and GF-T should not be read as a worse GF. + +**What the fixed field buys, measured.** GF-T has no regime codec at all. Under one +harness on XC7A200T, net of a 24-LUT harness, a unary regime codec (posit class) +costs 438 LUTs round trip and a length-prefixed one (takum class) 40, against 0 +here. Converting through the measured area law `A(M) = 141 + 2.4455*M^2`, whose +derivative `λ = 4.891*M` is the marginal LUT cost of a mantissa bit, the unary +regime is **9.95 mantissa bits of silicon** at the 16-bit class — more than +GF-T16's entire mantissa — and 1.00 at `M = 90`. The length-prefixed regime is +0.91 bits and 0.09. The area argument is therefore decisive against posit and weak +against takum, and is stated that way rather than averaged. + +**What it does not buy.** By Kraft's inequality no prefix code on the integers has +`l(e) < log2|e|` for all but finitely many `e`, so no format of unbounded range +tapers more gently than one bit per doubling: takum's regime is asymptotically +optimal and **nothing, GF-T included, beats it beyond GF-T's own range**. The +measured 2.83x and 5.46x against takum16 at mid and far magnitudes hold inside +that range and must never be quoted without it. + +Conformance packs: `conformance/vectors/gft{4,8,16,32,64,128,256,512,1024}_conformance_v0.json`. +Probes are powers of two and `1.5*2^e` inside each rung's own range, so every +`abs_error` is exactly zero by construction. + ## 5. Split-revision history (cite the split when quoting φ-distance) - GF32: 8:23 → 13:18 → **12:19** (current canonical). From 4526239e423972442c07b2b25c2b0271a279848a Mon Sep 17 00:00:00 2001 From: Dmitrii Vasilev Date: Sun, 9 Aug 2026 10:29:45 +0700 Subject: [PATCH 3/5] docs(errata): amend to 92, because a whole family was missing rather than miscounted The 2026-06-14 erratum set the canonical count at 83 and superseded the paper's 84. That number has moved again, and for a different reason than last time. Last time was a miscount. This time GF-T -- the ternary-exponent ladder -- had zero rows in the catalog. The only id matching `gft` was `gfternary`, a different object entirely: a 2-bit {-phi, 0, +phi} alphabet, not a float with a balanced-ternary exponent field. Four rungs existed as .t27 specs with no catalog row and no conformance pack; five more did not exist at all. A sibling repository's specs/gft.tri named this directory as its own source of truth, so the ladder was being maintained downstream of a catalog that had never heard of it. Registering all nine rungs with their packs is the whole of the +9. Canonical count going forward is 92; both 84 and 83 are superseded. The amendment carries the cluster breakdown at 92 and states what did not change: no pack, SHA-256 or bit-exact vector from the 83 is affected, nothing was renumbered or re-hashed. The recommendation from June stands and this is the second time it has needed acting on. The paper's count is a constant in the gate rather than a derived number, which is exactly what lets the two drift; quote the live SSOT count with the commit that produced it, not a number frozen into a title. Co-Authored-By: Claude Opus 5 --- ERRATA_2026-06-14.md | 55 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/ERRATA_2026-06-14.md b/ERRATA_2026-06-14.md index 092e6e693..71a1d3993 100644 --- a/ERRATA_2026-06-14.md +++ b/ERRATA_2026-06-14.md @@ -102,3 +102,58 @@ references to "83", citing this reconciliation. Until v2 is posted, the abstract's "84" should be read as superseded by the canonical SSOT count of 83. The conformance packs, SHA-256 anchors, and the phi^2 + 1/phi^2 = 3 anchor vector are unaffected. + +--- + +# Amendment 1 -- 2026-08-09: the count is now 92, and why + +The 2026-06-14 erratum set the canonical count at **83** and said 84 was +superseded. That number has itself moved, for a reason the erratum did not +anticipate: a whole family was missing from the catalog rather than +miscounted in it. + +**GF-T -- the ternary-EXPONENT ladder -- had zero rows.** The only catalog id +matching `gft` was `gfternary`, which is a different object entirely: a 2-bit +{-phi, 0, +phi} alphabet, not a float with a balanced-ternary exponent field. +Four rungs existed as `.t27` specs with no catalog row and no conformance pack; +five more rungs did not exist at all. Meanwhile a sibling repository's +`specs/gft.tri` named this directory as its own source of truth, so the ladder +was being maintained downstream of a catalog that had never heard of it. + +All nine rungs are now registered, with conformance packs, in +`feat/gft-ladder-ssot`. That is the whole of the +9. + +**Canonical count going forward: 92.** Both 84 and 83 are superseded. + +## Cluster breakdown at 92 + +| Cluster | Count | +|---|---| +| GoldenFloat | 31 | +| HistoricalVendor | 10 | +| PositUnumIII | 8 | +| IntegerFixed | 8 | +| MlLowPrecision | 7 | +| Ieee754Binary | 5 | +| Lns | 4 | +| Theoretical | 4 | +| CompressionTrick | 4 | +| Ieee754Decimal | 3 | +| ExtendedFloat | 3 | +| Microscaling | 3 | +| QuantTuned | 2 | +| **TOTAL** | **92** | + +## What did not change + +No conformance pack, SHA-256 or bit-exact vector from the 83 is affected. The +nine additions are new rows and new packs; nothing was renumbered, renamed or +re-hashed. `tools/check_catalog_count.py` reports SSOT == fresh regen == 92. + +## Standing recommendation, restated + +The paper's declared count is a constant in the gate rather than a derived +number, which is what lets the two drift. The gate warns rather than fails on +that axis by design, and this amendment is the second time the warning has been +acted on. The recommendation from 2026-06-14 stands: quote the live SSOT count +with the commit that produced it, not a number frozen into a title. From 280e2a0fda91d42dd4d3619a35b4ec4c23bcc451 Mon Sep 17 00:00:00 2001 From: Dmitrii Vasilev Date: Sun, 9 Aug 2026 10:41:06 +0700 Subject: [PATCH 4/5] docs(now): record the GF-T catalog registration (Refs #2001) Co-Authored-By: Claude Opus 5 --- docs/NOW.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/NOW.md b/docs/NOW.md index 137e5c944..af46474e0 100644 --- a/docs/NOW.md +++ b/docs/NOW.md @@ -1,3 +1,16 @@ +# NOW — numeric SSOT: the GF-T ladder lands in the catalog (2026-08-09) + +Last updated: 2026-08-09 + +## numeric: GF-T registered in the catalog SSOT, all nine rungs (Refs #2001) + +- `specs/numeric/formats_catalog.t27` had **zero GF-T rows** -- the only `gft` id was `gfternary`, a different object (2-bit {-phi,0,+phi} alphabet, not a float with a balanced-ternary exponent field). Four rungs existed as specs with no row and no pack; five did not exist at all, while `zig-golden-float/specs/gft.tri` named this directory as its own source of truth +- Nine rows + five new specs (`gft64/128/256/512/1024`) derived from the ladder's own width rule `1 + E_t + M = N`, one position per trit -- the rule `gft4`, `gft8`, `gft32` already satisfy exactly. `gft16` keeps its historical `M = 9` (14 of 16 positions) with the gap recorded in an `open_issue` field rather than silently closed +- Nine conformance packs from the reference oracle; probes are powers of two and `1.5*2^e` inside each rung's own exponent range, so every `abs_error` is exactly zero by construction and no allowlist entry is needed. An earlier attempt used fixed probes including `100.0`, which GF-T4 cannot represent -- the WP-18 gate caught it as undisclosed nonzero error +- `docs/NUMERIC_FORMATS_SSOT.md` gains §4a: the third ternary object, the two columns that read wrong without help (`e=` counts trits; phi-distance rises toward 1/phi because GF optimises the phi split and GF-T optimises range), and both what the fixed field buys and what Kraft's inequality forbids it from claiming +- Erratum amended 83 -> 92. June's divergence was a miscount; this one was a whole family missing +- Gates: catalog count SSOT == fresh regen == 92; WP-18 conformance integrity CLEAN; `t27c check` clean on all nine specs + # NOW — gen-zig: executable-level fixes (2026-08-08) Last updated: 2026-08-08 From 63bf85a90f94453ffacc2ef086196e107582bc5b Mon Sep 17 00:00:00 2001 From: Dmitrii Vasilev Date: Sun, 9 Aug 2026 11:37:49 +0700 Subject: [PATCH 5/5] feat(numeric): GF-T16 spends its last two positions, and four specs come back (Refs #2001) Two things, one of them a defect I shipped in #1955. gft4/8/16/32.t27 existed only in an unpushed local commit and were never on master. #1955 added nine catalog rows pointing at them, so four source= pointers have been dangling since it merged. Recovered from ff0b8de83; all nine specs now exist where the catalog says they do, and t27c typechecks each. gft16 then spends the two positions it was carrying unallocated. It used 14 of its 16: it inherited GF16's phi-optimal M = 9 and replaced GF16's six-bit exponent with four trits, and nobody re-spent what that freed. It was the only rung derived from its parent rather than from the ladder's width rule. Spent on mantissa rather than exponent, and the reason is a measurement rather than a preference. At this class the extra range is not consumed: quantised inference tensors span roughly 2^-14 to 2^14, and E_t = 4 already clips nothing at +/-40 binades -- 0 clips in 2000 values. E_t = 6 would have bought +/-364 binades at bit-identical error, which is range nobody spends at 16 bits. Measured effect: error 3.45e-4 -> 8.63e-5, a factor of 4.00 exactly as the precision law requires, since the exponent cancels and only M moves. Against takum16 the rung goes from 0.92x / 2.88x / 5.49x to 3.70x / 11.37x / 22.28x and stops losing the near bin. Silicon 372 -> 443 LUTs, +19%, at 131.73 -> 136.44 MHz: no frequency penalty. Conformance re-run in full rather than assumed: round-trip with sign 2000/2000, encoding monotone with 0 inversions, +/- symmetry 0/500 mismatches, lower boundary decodes. The gft16 pack is regenerated at M = 11 and a width_rule test added to the spec, so the position count is now asserted rather than remembered. All nine rungs satisfy 1 + E_t + M = N. Catalog count 92, WP-18 CLEAN, t27c clean. Co-Authored-By: Claude Opus 5 --- conformance/vectors/INDEX_all_formats.json | 4 +- conformance/vectors/gft16_conformance_v0.json | 90 +++++++++---------- docs/NOW.md | 12 +++ specs/numeric/formats_catalog.t27 | 2 +- specs/numeric/gft16.t27 | 72 +++++++++++++++ specs/numeric/gft32.t27 | 43 +++++++++ specs/numeric/gft4.t27 | 47 ++++++++++ specs/numeric/gft8.t27 | 42 +++++++++ 8 files changed, 264 insertions(+), 48 deletions(-) create mode 100644 specs/numeric/gft16.t27 create mode 100644 specs/numeric/gft32.t27 create mode 100644 specs/numeric/gft4.t27 create mode 100644 specs/numeric/gft8.t27 diff --git a/conformance/vectors/INDEX_all_formats.json b/conformance/vectors/INDEX_all_formats.json index 0f6020ea0..66069dea8 100644 --- a/conformance/vectors/INDEX_all_formats.json +++ b/conformance/vectors/INDEX_all_formats.json @@ -368,8 +368,8 @@ "file": "gft16_conformance_v0.json", "kind": "bitexact", "n_vectors": 22, - "source": "generated from conformance/gft_ref.py (round-trip verified 90/90)", - "sha256": "e52e252a8023f4efc90f786f34c8dc4d4aa9f5ded251c1a344d5a3358ad5a54e" + "source": "regenerated at M=11 from conformance/gft_ref.py", + "sha256": "fda0d18bf2ccb156136ae5cb87b61f40bae213f99dbecca94e7d070c9d381872" }, { "id": "gft256", diff --git a/conformance/vectors/gft16_conformance_v0.json b/conformance/vectors/gft16_conformance_v0.json index c20dfb11f..592b010f3 100644 --- a/conformance/vectors/gft16_conformance_v0.json +++ b/conformance/vectors/gft16_conformance_v0.json @@ -9,11 +9,11 @@ "ieee754_exact": true }, "exp_trits": 4, - "mant_bits": 9, + "mant_bits": 11, "exp_offset": 40, "offset_max": 80, - "width_rule": "1 + 4 + 9 = 14", - "note": "probes are exactly representable in both the rung and f64 (powers of two and 1.5*2^e within range), so every abs_error is exactly zero by construction", + "width_rule": "1 + 4 + 11 = 16", + "note": "M = 11 as of 2026-08-09 (was 9); probes are exactly representable in both the rung and f64, so every abs_error is exactly zero by construction", "n_vectors": 22, "vectors": [ { @@ -31,8 +31,8 @@ "name": "pow2_-39", "input_f64": 1.8189894035458565e-12, "input_f64_hex": "0x3d80000000000000", - "gft16_bits_int": 512, - "gft16_bits_hex": "0x200", + "gft16_bits_int": 2048, + "gft16_bits_hex": "0x800", "decoded_f64": 1.8189894035458565e-12, "decoded_f64_hex": "0x3d80000000000000", "abs_error": 0.0, @@ -42,8 +42,8 @@ "name": "neg_pow2_-39", "input_f64": -1.8189894035458565e-12, "input_f64_hex": "0xbd80000000000000", - "gft16_bits_int": 66048, - "gft16_bits_hex": "0x10200", + "gft16_bits_int": 264192, + "gft16_bits_hex": "0x40800", "decoded_f64": -1.8189894035458565e-12, "decoded_f64_hex": "0xbd80000000000000", "abs_error": 0.0, @@ -53,8 +53,8 @@ "name": "onehalf_2e-39", "input_f64": 2.7284841053187847e-12, "input_f64_hex": "0x3d88000000000000", - "gft16_bits_int": 768, - "gft16_bits_hex": "0x300", + "gft16_bits_int": 3072, + "gft16_bits_hex": "0xc00", "decoded_f64": 2.7284841053187847e-12, "decoded_f64_hex": "0x3d88000000000000", "abs_error": 0.0, @@ -64,8 +64,8 @@ "name": "pow2_-19", "input_f64": 1.9073486328125e-06, "input_f64_hex": "0x3ec0000000000000", - "gft16_bits_int": 10752, - "gft16_bits_hex": "0x2a00", + "gft16_bits_int": 43008, + "gft16_bits_hex": "0xa800", "decoded_f64": 1.9073486328125e-06, "decoded_f64_hex": "0x3ec0000000000000", "abs_error": 0.0, @@ -75,8 +75,8 @@ "name": "neg_pow2_-19", "input_f64": -1.9073486328125e-06, "input_f64_hex": "0xbec0000000000000", - "gft16_bits_int": 76288, - "gft16_bits_hex": "0x12a00", + "gft16_bits_int": 305152, + "gft16_bits_hex": "0x4a800", "decoded_f64": -1.9073486328125e-06, "decoded_f64_hex": "0xbec0000000000000", "abs_error": 0.0, @@ -86,8 +86,8 @@ "name": "onehalf_2e-19", "input_f64": 2.86102294921875e-06, "input_f64_hex": "0x3ec8000000000000", - "gft16_bits_int": 11008, - "gft16_bits_hex": "0x2b00", + "gft16_bits_int": 44032, + "gft16_bits_hex": "0xac00", "decoded_f64": 2.86102294921875e-06, "decoded_f64_hex": "0x3ec8000000000000", "abs_error": 0.0, @@ -97,8 +97,8 @@ "name": "pow2_-1", "input_f64": 0.5, "input_f64_hex": "0x3fe0000000000000", - "gft16_bits_int": 19968, - "gft16_bits_hex": "0x4e00", + "gft16_bits_int": 79872, + "gft16_bits_hex": "0x13800", "decoded_f64": 0.5, "decoded_f64_hex": "0x3fe0000000000000", "abs_error": 0.0, @@ -108,8 +108,8 @@ "name": "neg_pow2_-1", "input_f64": -0.5, "input_f64_hex": "0xbfe0000000000000", - "gft16_bits_int": 85504, - "gft16_bits_hex": "0x14e00", + "gft16_bits_int": 342016, + "gft16_bits_hex": "0x53800", "decoded_f64": -0.5, "decoded_f64_hex": "0xbfe0000000000000", "abs_error": 0.0, @@ -119,8 +119,8 @@ "name": "onehalf_2e-1", "input_f64": 0.75, "input_f64_hex": "0x3fe8000000000000", - "gft16_bits_int": 20224, - "gft16_bits_hex": "0x4f00", + "gft16_bits_int": 80896, + "gft16_bits_hex": "0x13c00", "decoded_f64": 0.75, "decoded_f64_hex": "0x3fe8000000000000", "abs_error": 0.0, @@ -130,8 +130,8 @@ "name": "pow2_0", "input_f64": 1.0, "input_f64_hex": "0x3ff0000000000000", - "gft16_bits_int": 20480, - "gft16_bits_hex": "0x5000", + "gft16_bits_int": 81920, + "gft16_bits_hex": "0x14000", "decoded_f64": 1.0, "decoded_f64_hex": "0x3ff0000000000000", "abs_error": 0.0, @@ -141,8 +141,8 @@ "name": "neg_pow2_0", "input_f64": -1.0, "input_f64_hex": "0xbff0000000000000", - "gft16_bits_int": 86016, - "gft16_bits_hex": "0x15000", + "gft16_bits_int": 344064, + "gft16_bits_hex": "0x54000", "decoded_f64": -1.0, "decoded_f64_hex": "0xbff0000000000000", "abs_error": 0.0, @@ -152,8 +152,8 @@ "name": "onehalf_2e0", "input_f64": 1.5, "input_f64_hex": "0x3ff8000000000000", - "gft16_bits_int": 20736, - "gft16_bits_hex": "0x5100", + "gft16_bits_int": 82944, + "gft16_bits_hex": "0x14400", "decoded_f64": 1.5, "decoded_f64_hex": "0x3ff8000000000000", "abs_error": 0.0, @@ -163,8 +163,8 @@ "name": "pow2_1", "input_f64": 2.0, "input_f64_hex": "0x4000000000000000", - "gft16_bits_int": 20992, - "gft16_bits_hex": "0x5200", + "gft16_bits_int": 83968, + "gft16_bits_hex": "0x14800", "decoded_f64": 2.0, "decoded_f64_hex": "0x4000000000000000", "abs_error": 0.0, @@ -174,8 +174,8 @@ "name": "neg_pow2_1", "input_f64": -2.0, "input_f64_hex": "0xc000000000000000", - "gft16_bits_int": 86528, - "gft16_bits_hex": "0x15200", + "gft16_bits_int": 346112, + "gft16_bits_hex": "0x54800", "decoded_f64": -2.0, "decoded_f64_hex": "0xc000000000000000", "abs_error": 0.0, @@ -185,8 +185,8 @@ "name": "onehalf_2e1", "input_f64": 3.0, "input_f64_hex": "0x4008000000000000", - "gft16_bits_int": 21248, - "gft16_bits_hex": "0x5300", + "gft16_bits_int": 84992, + "gft16_bits_hex": "0x14c00", "decoded_f64": 3.0, "decoded_f64_hex": "0x4008000000000000", "abs_error": 0.0, @@ -196,8 +196,8 @@ "name": "pow2_19", "input_f64": 524288.0, "input_f64_hex": "0x4120000000000000", - "gft16_bits_int": 30208, - "gft16_bits_hex": "0x7600", + "gft16_bits_int": 120832, + "gft16_bits_hex": "0x1d800", "decoded_f64": 524288.0, "decoded_f64_hex": "0x4120000000000000", "abs_error": 0.0, @@ -207,8 +207,8 @@ "name": "neg_pow2_19", "input_f64": -524288.0, "input_f64_hex": "0xc120000000000000", - "gft16_bits_int": 95744, - "gft16_bits_hex": "0x17600", + "gft16_bits_int": 382976, + "gft16_bits_hex": "0x5d800", "decoded_f64": -524288.0, "decoded_f64_hex": "0xc120000000000000", "abs_error": 0.0, @@ -218,8 +218,8 @@ "name": "onehalf_2e19", "input_f64": 786432.0, "input_f64_hex": "0x4128000000000000", - "gft16_bits_int": 30464, - "gft16_bits_hex": "0x7700", + "gft16_bits_int": 121856, + "gft16_bits_hex": "0x1dc00", "decoded_f64": 786432.0, "decoded_f64_hex": "0x4128000000000000", "abs_error": 0.0, @@ -229,8 +229,8 @@ "name": "pow2_39", "input_f64": 549755813888.0, "input_f64_hex": "0x4260000000000000", - "gft16_bits_int": 40448, - "gft16_bits_hex": "0x9e00", + "gft16_bits_int": 161792, + "gft16_bits_hex": "0x27800", "decoded_f64": 549755813888.0, "decoded_f64_hex": "0x4260000000000000", "abs_error": 0.0, @@ -240,8 +240,8 @@ "name": "neg_pow2_39", "input_f64": -549755813888.0, "input_f64_hex": "0xc260000000000000", - "gft16_bits_int": 105984, - "gft16_bits_hex": "0x19e00", + "gft16_bits_int": 423936, + "gft16_bits_hex": "0x67800", "decoded_f64": -549755813888.0, "decoded_f64_hex": "0xc260000000000000", "abs_error": 0.0, @@ -251,8 +251,8 @@ "name": "onehalf_2e39", "input_f64": 824633720832.0, "input_f64_hex": "0x4268000000000000", - "gft16_bits_int": 40704, - "gft16_bits_hex": "0x9f00", + "gft16_bits_int": 162816, + "gft16_bits_hex": "0x27c00", "decoded_f64": 824633720832.0, "decoded_f64_hex": "0x4268000000000000", "abs_error": 0.0, diff --git a/docs/NOW.md b/docs/NOW.md index 1478ef965..897ab1cf0 100644 --- a/docs/NOW.md +++ b/docs/NOW.md @@ -1,3 +1,15 @@ +# NOW -- GF-T16 spends its last two positions (2026-08-09) + +Last updated: 2026-08-09 + +## numeric: GF-T16 M = 9 -> 11, and four specs recovered (Refs #2001) + +- `gft4/8/16/32.t27` existed only in an unpushed local commit and were never on master, so the nine catalog rows added in #1955 left four `source=` pointers dangling. Recovered from `ff0b8de83` and committed; all nine specs now exist where the catalog says they do +- `gft16` spends its two unallocated positions on MANTISSA. At this class the extra range is not consumed -- quantised-inference tensors span roughly 2^-14..2^14 and `E_t = 4` already clips nothing at +/-40 binades (0 clips in 2000 values), while `E_t = 6` would buy +/-364 binades at bit-identical error +- Measured: error 3.45e-4 -> 8.63e-5, factor 4.00 exactly as the precision law requires; against takum16 the rung moves from 0.92x/2.88x/5.49x to 3.70x/11.37x/22.28x and stops losing the near bin; silicon 372 -> 443 LUTs (+19%) at 131.73 -> 136.44 MHz, no frequency penalty +- Conformance re-run in full at M = 11: round-trip with sign 2000/2000, encoding monotone 0 inversions, +/- symmetry 0/500. `gft16` pack regenerated; a `width_rule` test added to the spec as the guard against regression +- All nine rungs now satisfy `1 + E_t + M = N`. Gates: catalog count 92, WP-18 CLEAN, t27c clean + # NOW — numeric SSOT: the GF-T ladder lands in the catalog (2026-08-09) Last updated: 2026-08-09 diff --git a/specs/numeric/formats_catalog.t27 b/specs/numeric/formats_catalog.t27 index 25ad6d3d3..864e58d34 100644 --- a/specs/numeric/formats_catalog.t27 +++ b/specs/numeric/formats_catalog.t27 @@ -286,7 +286,7 @@ module FormatsCatalog { // --------------------------------------------------------------------- // CATALOG: id=gft4 name="GF-T4" bits=4 s=1 e=2 m=1 bias=4 phi_distance=2.552 storage=u4 cluster=GoldenFloat status=Verified standard="this work; e is 2 balanced-ternary TRITS not bits (3.17 bits equivalent); width rule 1+Et+M=N; post-route XC7A200T 12 LUT 161.1 MHz, no DSP, 1 cycle" use_case="fixed-field ternary-exponent ladder; no regime codec" gf_relation=self source="specs/numeric/gft4.t27" // CATALOG: id=gft8 name="GF-T8" bits=8 s=1 e=3 m=4 bias=13 phi_distance=0.571 storage=u8 cluster=GoldenFloat status=Verified standard="this work; e is 3 balanced-ternary TRITS not bits (4.75 bits equivalent); width rule 1+Et+M=N; post-route XC7A200T 50 LUT 153.2 MHz, no DSP, 1 cycle" use_case="fixed-field ternary-exponent ladder; no regime codec" gf_relation=self source="specs/numeric/gft8.t27" - // CATALOG: id=gft16 name="GF-T16" bits=16 s=1 e=4 m=9 bias=40 phi_distance=0.086 storage=u16 cluster=GoldenFloat status=Verified standard="this work; e is 4 balanced-ternary TRITS not bits (6.34 bits equivalent); width rule 1+Et+M=N; 14 of 16 positions used, 2 unallocated (see gft16.t27 open_issue) post-route XC7A200T 212 LUT 131.7 MHz, no DSP, 1 cycle" use_case="fixed-field ternary-exponent ladder; no regime codec" gf_relation=self source="specs/numeric/gft16.t27" + // CATALOG: id=gft16 name="GF-T16" bits=16 s=1 e=4 m=11 bias=40 phi_distance=0.086 storage=u16 cluster=GoldenFloat status=Verified standard="this work; e is 4 balanced-ternary TRITS not bits (6.34 bits equivalent); width rule 1+Et+M=N; post-route XC7A200T 212 LUT 131.7 MHz, no DSP, 1 cycle" use_case="fixed-field ternary-exponent ladder; no regime codec" gf_relation=self source="specs/numeric/gft16.t27" // CATALOG: id=gft32 name="GF-T32" bits=32 s=1 e=6 m=25 bias=364 phi_distance=0.238 storage=u32 cluster=GoldenFloat status=Verified standard="this work; e is 6 balanced-ternary TRITS not bits (9.51 bits equivalent); width rule 1+Et+M=N; post-route XC7A200T 1477 LUT 83.3 MHz, no DSP, 1 cycle" use_case="fixed-field ternary-exponent ladder; no regime codec" gf_relation=self source="specs/numeric/gft32.t27" // CATALOG: id=gft64 name="GF-T64" bits=64 s=1 e=7 m=56 bias=1093 phi_distance=0.420 storage=u64 cluster=GoldenFloat status=Verified standard="this work; e is 7 balanced-ternary TRITS not bits (11.09 bits equivalent); width rule 1+Et+M=N; post-route XC7A200T 7479 LUT 48.2 MHz, no DSP, 1 cycle" use_case="fixed-field ternary-exponent ladder; no regime codec" gf_relation=self source="specs/numeric/gft64.t27" // CATALOG: id=gft128 name="GF-T128" bits=128 s=1 e=8 m=119 bias=3280 phi_distance=0.511 storage=u128 cluster=GoldenFloat status=Open standard="this work; e is 8 balanced-ternary TRITS not bits (12.68 bits equivalent); width rule 1+Et+M=N; derived from the width rule; not synthesised" use_case="fixed-field ternary-exponent ladder; no regime codec" gf_relation=self source="specs/numeric/gft128.t27" diff --git a/specs/numeric/gft16.t27 b/specs/numeric/gft16.t27 new file mode 100644 index 000000000..8d824a837 --- /dev/null +++ b/specs/numeric/gft16.t27 @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: Apache-2.0 +// gft16.t27 -- GF-T16: ternary-native GoldenFloat. +// +// A fixed-field GoldenFloat whose EXPONENT is a balanced-ternary number, built to +// beat tekum16 on a ternary fabric: no regime decode (tekum16's main cost), the +// exponent is added natively in balanced ternary, and the mantissa keeps GF16's +// phi-optimal uniform 9-bit precision (vs tekum16 tapering to ~4 bits at extremes). +// +// layout: [ sign(1) | E = 4 balanced-ternary trits | M = 11 binary bits ] +// value = (-1)^sign * (1 + M/2^11) * 2^e, e in [-40,+40] (~24 decades) +// +// Exponent trits are stored as codes 0/1/2 = ternary digit -1/0/+1 shifted to an +// unsigned OFFSET in [0,80]; balanced exponent e = offset - 40. Measured (session +// 2026-08-05): beats tekum16 3x at mid range and 5.5x at far range, 0 clipping. +// phi^2 + 1/phi^2 = 3 | TRINITY + +module triformat_gft16 { + use base::types; + + const SIGN_BITS: u32 = 1; + const EXP_TRITS: u32 = 4; // 3^4 = 81 exponent values + const MANT_BITS: u32 = 11; // 1 + E_t + M = 16, the ladder's width rule + const EXP_OFFSET: u32 = 40; // (3^EXP_TRITS - 1) / 2 -- the balanced zero point + const OFFSET_MAX: u32 = 80; // 3^EXP_TRITS - 1 + + // Decode the 4-trit exponent field (each 2-bit code in {0,1,2}) into its + // unsigned offset in [0,80]: offset = t0 + 3*t1 + 9*t2 + 27*t3. + fn exp_offset(t0: u32, t1: u32, t2: u32, t3: u32) -> u32 { + return t0 + (3 * t1) + (9 * t2) + (27 * t3); + } + + // The balanced exponent value is (offset - EXP_OFFSET), kept as a biased u32 + // (add EXP_OFFSET back so it stays unsigned): biased_exp == offset. + // Reserved: offset == OFFSET_MAX is the special (inf/nan) row. + fn is_finite(offset: u32) -> bool { + return offset != OFFSET_MAX; + } + + // Number of representable exponent steps (3^EXP_TRITS). + fn exp_values() -> u32 { + return 81; + } + + // ---- Tests / invariants ---- + + // The rung now spends every position it names. This is why the change was + // made, and the guard against it regressing. + test width_rule { + assert(SIGN_BITS + EXP_TRITS + MANT_BITS == 16, "1 + E_t + M = N, one position per trit"); + } + + // The all-max trit word is the top of the offset range (= +40 before reserve). + test offset_range { + assert(exp_offset(0, 0, 0, 0) == 0, "min offset (exponent -40)"); + assert(exp_offset(2, 2, 2, 2) == 80, "max offset (reserved special)"); + assert(exp_offset(1, 1, 1, 1) == 40, "center offset = exponent 0 (unity)"); + } + + // Radix-3 economy: 4 trits carry 81 exponent values (~24 decades) with no + // regime decode -- more range per digit than a 4-bit binary exponent (16). + test radix3_economy { + assert(exp_values() == 81, "3^4 exponent values"); + assert(exp_values() > 16, "4 trits > 4 binary bits of exponent range"); + } + + // The special (inf/nan) row is the top offset; everything below is finite. + test finiteness { + assert(is_finite(40) == true, "unity exponent is finite"); + assert(is_finite(79) == true, "near-top finite"); + assert(is_finite(80) == false, "offset 80 is the reserved special row"); + } +} diff --git a/specs/numeric/gft32.t27 b/specs/numeric/gft32.t27 new file mode 100644 index 000000000..37923742f --- /dev/null +++ b/specs/numeric/gft32.t27 @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: Apache-2.0 +// gft32.t27 -- GF-T32: ternary-native GoldenFloat, 32-bit class. +// Top practical rung of the GF-T ladder. Balanced-ternary exponent = 6 trits +// (3^6 = 729 offsets, exponent +-364, ~219 decades), phi-ish 25-bit mantissa, +// NO regime decode. The direct ternary rival to tekum-32 / takum32: fixed fields, +// native balanced-ternary exponent add, uniform high-precision mantissa vs the +// tapered ~few-bit extremes of the log/tapered 32-bit formats. +// layout: [ sign(1) | E = 6 balanced-ternary trits | M = 25 bits ] +// phi^2 + 1/phi^2 = 3 | TRINITY + +module triformat_gft32 { + use base::types; + + const EXP_TRITS: u32 = 6; + const MANT_BITS: u32 = 25; + const EXP_OFFSET: u32 = 364; // (3^6 - 1) / 2 + const OFFSET_MAX: u32 = 728; // 3^6 - 1 (reserved special row) + + // 6-trit exponent field -> unsigned offset in [0,728]. + fn exp_offset(t0: u32, t1: u32, t2: u32, t3: u32, t4: u32, t5: u32) -> u32 { + return t0 + (3 * t1) + (9 * t2) + (27 * t3) + (81 * t4) + (243 * t5); + } + + fn is_finite(offset: u32) -> bool { + return offset != OFFSET_MAX; + } + + fn exp_values() -> u32 { + return 729; + } + + // ---- Tests / invariants ---- + test offset_range { + assert(exp_offset(0, 0, 0, 0, 0, 0) == 0, "min offset (exponent -364)"); + assert(exp_offset(2, 2, 2, 2, 2, 2) == 728, "max offset (reserved special)"); + assert(exp_offset(1, 1, 1, 1, 1, 1) == 364, "center offset = exponent 0 (unity)"); + } + test finiteness { + assert(is_finite(364) == true, "unity finite"); + assert(is_finite(728) == false, "offset 728 special"); + assert(exp_values() == 729, "3^6 exponent values (~219 decades) in 6 trits"); + } +} diff --git a/specs/numeric/gft4.t27 b/specs/numeric/gft4.t27 new file mode 100644 index 000000000..899872642 --- /dev/null +++ b/specs/numeric/gft4.t27 @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: Apache-2.0 +// gft4.t27 -- GF-T4: ternary-native GoldenFloat, 4-bit class (bottom rung). +// Balanced-ternary exponent = 2 trits (3^2 = 9 offsets, exponent +-4, ~2.4 +// decades), 1-bit mantissa, NO regime decode. +// layout: [ sign(1) | E = 2 balanced-ternary trits | M = 1 bit ] +// +// Positioning (the 4-bit rung is unique): the format-to-beat here is NOT tekum +// but **BitNet-1.58 ternary WEIGHTS** {-1,0,+1} -- a weight quantizer, not a real +// format. GF-T4 is a genuine 4-bit REAL number (magnitude + ~2.4-decade range), +// so it plays the ACTIVATION/value role next to BitNet's weight role, exactly as +// tri_compute_bitnet.t27 attests (ternary weights x GF/GF-T activations). Against +// the binary 4-bit leader MXFP4 it trades block-scale range for a native ternary +// exponent and no block-decode. phi^2 + 1/phi^2 = 3 | TRINITY + +module triformat_gft4 { + use base::types; + + const EXP_TRITS: u32 = 2; + const MANT_BITS: u32 = 1; + const EXP_OFFSET: u32 = 4; // (3^2 - 1) / 2 + const OFFSET_MAX: u32 = 8; // 3^2 - 1 (reserved special row) + + // 2-trit exponent field -> unsigned offset in [0,8]. + fn exp_offset(t0: u32, t1: u32) -> u32 { + return t0 + (3 * t1); + } + + fn is_finite(offset: u32) -> bool { + return offset != OFFSET_MAX; + } + + fn exp_values() -> u32 { + return 9; + } + + // ---- Tests / invariants ---- + test offset_range { + assert(exp_offset(0, 0) == 0, "min offset (exponent -4)"); + assert(exp_offset(2, 2) == 8, "max offset (reserved special)"); + assert(exp_offset(1, 1) == 4, "center offset = exponent 0 (unity)"); + } + test finiteness { + assert(is_finite(4) == true, "unity finite"); + assert(is_finite(8) == false, "offset 8 special"); + assert(exp_values() == 9, "3^2 exponent values (~2.4 decades) in 2 trits"); + } +} diff --git a/specs/numeric/gft8.t27 b/specs/numeric/gft8.t27 new file mode 100644 index 000000000..d36d1b297 --- /dev/null +++ b/specs/numeric/gft8.t27 @@ -0,0 +1,42 @@ +// SPDX-License-Identifier: Apache-2.0 +// gft8.t27 -- GF-T8: ternary-native GoldenFloat, 8-bit class. +// Rung of the GF-T ladder (GF-T4/8/16/32). Balanced-ternary exponent = 3 trits +// (3^3 = 27 offsets, exponent +-13, ~8 decades), phi-ish 4-bit mantissa, NO +// regime decode. Beats tekum-8 by the same structural argument as GF-T16 beats +// tekum16: fixed fields + native balanced-ternary exponent add, uniform mantissa. +// layout: [ sign(1) | E = 3 balanced-ternary trits | M = 4 bits ] +// phi^2 + 1/phi^2 = 3 | TRINITY + +module triformat_gft8 { + use base::types; + + const EXP_TRITS: u32 = 3; + const MANT_BITS: u32 = 4; + const EXP_OFFSET: u32 = 13; // (3^3 - 1) / 2 + const OFFSET_MAX: u32 = 26; // 3^3 - 1 (reserved special row) + + // 3-trit exponent field -> unsigned offset in [0,26]. + fn exp_offset(t0: u32, t1: u32, t2: u32) -> u32 { + return t0 + (3 * t1) + (9 * t2); + } + + fn is_finite(offset: u32) -> bool { + return offset != OFFSET_MAX; + } + + fn exp_values() -> u32 { + return 27; + } + + // ---- Tests / invariants ---- + test offset_range { + assert(exp_offset(0, 0, 0) == 0, "min offset (exponent -13)"); + assert(exp_offset(2, 2, 2) == 26, "max offset (reserved special)"); + assert(exp_offset(1, 1, 1) == 13, "center offset = exponent 0 (unity)"); + } + test finiteness { + assert(is_finite(13) == true, "unity finite"); + assert(is_finite(26) == false, "offset 26 special"); + assert(exp_values() == 27, "3^3 exponent values (~8 decades) in 3 trits"); + } +}