Skip to content

wave-15: canonical GF16 import -- ring-088 (real, tested, cross-kernel identity) (Closes #717)#718

Merged
gHashTag merged 1 commit into
masterfrom
wave-15/ring-088-gf16-mac
May 22, 2026
Merged

wave-15: canonical GF16 import -- ring-088 (real, tested, cross-kernel identity) (Closes #717)#718
gHashTag merged 1 commit into
masterfrom
wave-15/ring-088-gf16-mac

Conversation

@gHashTag
Copy link
Copy Markdown
Owner

Wave 15 — Canonical GF16 Import (ring-088)

Closes #717

What

The first honestly-authored Wave-11 crate. rings/ring-088-rust/ lands with a real GF16 codec, a real allocation-free mac_dot kernel, and the project's first cross-kernel identity test.

File Role
rings/ring-088-rust/Cargo.toml Standalone crate (covered by Wave-14 exclude = [..., "rings"])
rings/ring-088-rust/src/lib.rs 439 LOC — GF16 codec + mac_dot + identity_witness
rings/ring-088-rust/README.md Usage + test table

R5-HONEST audit (the reason this wave exists)

Wave 11's narrative claimed 12 Rust crates ring-088..ring-099 totalling ~9 930 LOC had been authored "in another sandbox". A full search of this repository, the past-session context, and every reachable workspace location found zero source files for any of those 12 rings. Wave-13 COMPILE_STATUS.md labelled them off-disk, but that was a placeholder, not a deliverable.

Wave 15 starts the real import with the most foundational ring (GF16) and reclassifies the remaining 11 to claimed-only until each receives the same real-source treatment.

What ring-088 actually does

  • GF16 codec f32 ↔ Gf16 faithful to specs/numeric/gf16.t27 — bit layout [S(1) E(6) M(9)], BIAS = 31, special exp 0x3F, separate +0/-0, canonical NaN 0xFE01. No new spec; all constants mirror existing spec byte-for-byte (L6 CEILING).
  • mac_dot(&[Gf16], &[Gf16]) -> Option<f32> — streaming, allocation-free dot product. None on length mismatch. Saturation on overflow. Subnormals flush to zero.
  • identity_witness()true iff phi^2 + 1/phi^2 == 3 to f64 1e-15.
  • #![no_std] (test cfg pulls std), #![forbid(unsafe_code)], #![deny(missing_docs)], zero external dependencies. Inline ldexp/frexp/floor helpers.

Local verification (Rust 1.83.0)

$ cargo check --all-targets
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.06s

$ cargo test --lib
running 13 tests
test tests::gf16_better_phi_distance_than_f16 ... ok
test tests::gf16_from_zero_neg ... ok
test tests::gf16_from_zero_pos ... ok
test tests::gf16_inf_roundtrip ... ok
test tests::gf16_nan_propagates ... ok
test tests::gf16_phi_identity ... ok
test tests::gf16_quantization_roundtrip_pi ... ok
test tests::gf16_roundtrip_phi ... ok
test tests::identity_witness_holds ... ok
test tests::mac_dot_empty ... ok
test tests::mac_dot_length_mismatch ... ok
test tests::mac_dot_phi_identity ... ok
test tests::mac_dot_simple ... ok

test result: ok. 13 passed; 0 failed; 0 ignored

The critical test

mac_dot_phi_identity is the first time in the project that the anchor φ² + 1/φ² = 3 is exercised through actual numeric kernels:

let phi = PHI as f32;
let inv = (1.0 / PHI) as f32;
let a = [Gf16::from_f32(phi), Gf16::from_f32(inv)];
let b = [Gf16::from_f32(phi), Gf16::from_f32(inv)];
let got = mac_dot(&a, &b).unwrap();        // GF16 encode -> MAC -> f32
assert!((got - 3.0).abs() < 0.02);          // tolerance for GF16's ~3 digits

Up until now identity_witness was a free-standing f64 assertion. This test wires the anchor into a real numeric pipeline.

COMPILE_STATUS promotions / reclassifications

  • ring-088-rustoff-diskcheck + test
  • ring-089..ring-099 (11 crates) — off-diskclaimed-only (legend gains a new row spelling out exactly what that means; LOC column relabelled "LOC (claimed)" with a preamble warning)

Constitutional compliance

  • L1 TRACEABILITYCloses #717 in title, body, commit
  • L2 GENERATION — zero edits under gen/, coq/, trios-coq/, proofs/, bootstrap/, specs/, conformance/, architecture/, root Cargo.toml
  • L3 PURITY — ASCII; English doc-comments
  • L4 TESTABILITY — 13 #[test]s (8 mandatory-from-spec + 4 MAC + 1 universal)
  • L5 IDENTITY — anchor exercised at both f64 and GF16-MAC levels
  • L6 CEILING — zero numeric kernel changes; constants mirror existing spec
  • L7 UNITY — no new *.sh; new files are .toml, .rs, .md

Anchor: φ² + 1/φ² = 3

…ty check) (Closes #717)

NEW (additive, rings-only):
- rings/ring-088-rust/Cargo.toml         standalone, no workspace
- rings/ring-088-rust/src/lib.rs (439)   GF16 codec + mac_dot + identity_witness
- rings/ring-088-rust/README.md           usage + test table

GF16 codec faithful to specs/numeric/gf16.t27:
  [S(1) E(6) M(9)], BIAS=31, special exp=0x3F (Inf/NaN),
  separate +0/-0, canonical NaN 0xFE01.
mac_dot(&[Gf16], &[Gf16]) -> Option<f32>: streaming, alloc-free,
  None on length mismatch.
identity_witness(): true iff phi^2 + 1/phi^2 == 3 (f64, 1e-15).
no_std (test cfg pulls std), forbid(unsafe_code), deny(missing_docs),
zero external dependencies. Inline ldexp/frexp/floor helpers.

Tests (13, all pass locally on Rust 1.83.0):
  8 mandatory from specs/02-gf16-format.tri:
    gf16_roundtrip_phi, gf16_from_zero_{pos,neg}, gf16_phi_identity,
    gf16_quantization_roundtrip_pi, gf16_better_phi_distance_than_f16,
    gf16_inf_roundtrip, gf16_nan_propagates
  4 MAC: mac_dot_{empty,length_mismatch,simple,phi_identity}
  1 universal: identity_witness_holds
  Critical: mac_dot_phi_identity -- FIRST cross-kernel exercise of the
  phi^2 + 1/phi^2 = 3 anchor (GF16 encode -> MAC -> f32 decode).

R5-HONEST audit: Wave-11 narrative claimed 12 crates ring-088..099 at
~9930 LOC authored 'in another sandbox'. None on disk. Wave 15 imports
ring-088 for real; remaining 11 reclassified from 'off-disk' to
'claimed-only' in rings/COMPILE_STATUS.md with explicit warning that
LOC numbers are quotes from past narrative, not measurements.

L1 TRACEABILITY/L2 GENERATION/L3 PURITY/L4 TESTABILITY/L5 IDENTITY/
L6 CEILING/L7 UNITY: all green.

Anchor: phi^2 + 1/phi^2 = 3

Closes #717
@github-actions
Copy link
Copy Markdown

📓 NotebookLM Notebook linked to this PR

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

@github-actions
Copy link
Copy Markdown

PR Dashboard

Generated at: 2026-05-22 09:54:53 UTC

Summary

Status Count
Total Open PRs 22
PRs with Failing Checks 20
PRs with All Checks Green 2
READY 1
FAILING 20
PENDING 0

@gHashTag gHashTag merged commit 45119e5 into master May 22, 2026
24 checks passed
@gHashTag gHashTag deleted the wave-15/ring-088-gf16-mac branch May 22, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wave-15: import ring-088 GF16 MAC as the first honestly-authored Wave-11 crate

1 participant