Skip to content

gft encoder: pin the smallest normal binade (Refs #2161) - #2637

Merged
gHashTag merged 2 commits into
masterfrom
fix/enc-smallest-binade
Aug 24, 2026
Merged

gft encoder: pin the smallest normal binade (Refs #2161)#2637
gHashTag merged 2 commits into
masterfrom
fix/enc-smallest-binade

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

Printing the source beside the line number (#2634, yesterday) paid for itself on the first survivor that did not classify itself: if off < 0: return 0, in the GF-T encoder every trained weight passes through.

off = e + 40, so off == 0 is the smallest normal binade, [2^-40, 2^-39). The mutant off <= 0 encodes every value there as 0 — which is the zero sentinel. A non-zero magnitude, silently reported as zero.

The obvious witness does not work, and that is why the mutant lived

At exactly 2^-40 the mantissa is 0, so the value already encodes as 0 and the mutation changes nothing. A witness needs a non-zero mantissa in that binade:

enc(1.5 * 2**-40) = 256      the mutant would give 0
enc(2**-40)       = 0        already zero — not a witness
enc(2**-41)       = 0        legitimately zero, off < 0

Anyone testing "the boundary" by reaching for the boundary value would have concluded the mutant was equivalent. The boundary value was the one point in the binade where it is.

Three assertions pin it: the magnitude, the sign, and the value one binade lower which is legitimately zero.

Negative control: with <= planted the tool exits 1 naming the new assertion; restored, 0. The column moved 5/31 → 6/31.

And it corrects a generalization I made yesterday

§106 concluded that boundary survivors are loop bounds where a survivor is the right answer. That was drawn from one gate's six survivors. Classifying all four if x < 0: sites:

site value comes from <= equivalent?
verify_igla_race:223 src.find("{", start) yes — 0 unreachable
gft_backprop_microcode:50 off = e + 40 no — smallest normal binade
gft_backprop_microcode:203 d = ho - lo_o no — equal exponents
diffbin:148 rest.rfind('"') no — empty quoted string ""

One of four. The rfind site is real despite sharing the idiom with the equivalent one — what differs is whether index 0 is reachable in that string, not which function produced it.

The correction is not "survivors are real" either: each survivor is a separate question, and the source line makes answering it a minute's work instead of an afternoon's.

§110 and §111.

Refs #2161

`if off < 0: return 0` survived the boundary operator. Printing the
source beside the line number (#2634, yesterday) showed it is not a
loop bound.

`off = e + 40` is ZERO in the smallest normal binade, [2^-40, 2^-39).
With `<=`, every value there encodes as 0 -- which is the ZERO
SENTINEL. A non-zero magnitude silently reported as zero, in the
encoder every trained weight passes through.

The exact power 2^-40 is NOT a witness: its mantissa is 0, so it
already encodes as 0 and the mutant changes nothing there. A witness
needs a non-zero mantissa in that binade, so the pin is 1.5*2^-40,
which encodes 256 and would become 0.

Three assertions: the magnitude, the sign, and the value one binade
below which IS legitimately zero. Negative control: with `<=` planted
the tool exits 1 on the new assertion naming it; restored, 0.

Nothing else in this file reaches that binade -- every value the
training self-tests encode sits many binades higher, which is why the
mutant lived.

This also corrects a generalization I made yesterday. Of the four
`if x < 0:` sites across the tools, only the `find()` idiom in
verify_igla_race is equivalent (find returns -1 or an index, and every
caller passes a match start whose first character is a keyword). The
other three -- this one, `d < 0` in _magsub, and `end < 0` after
rfind in diffbin -- are real boundaries where 0 is a valid value.
"Boundary survivors are loop bounds" was too broad.

Refs #2161
@github-actions

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

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

@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-24 00:27:41 UTC

Summary

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

Seal Status

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

@gHashTag
gHashTag merged commit f631fa4 into master Aug 24, 2026
27 of 28 checks passed
@gHashTag
gHashTag deleted the fix/enc-smallest-binade branch August 24, 2026 00:40
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.

1 participant