gft encoder: pin the smallest normal binade (Refs #2161) - #2637
Merged
Conversation
`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
…its witness (Refs #2161)
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
PR DashboardGenerated at: 2026-08-24 00:27:41 UTC
Summary
Seal Status
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, sooff == 0is the smallest normal binade,[2^-40, 2^-39). The mutantoff <= 0encodes every value there as0— 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^-40the 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: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:<=equivalent?verify_igla_race:223src.find("{", start)gft_backprop_microcode:50off = e + 40gft_backprop_microcode:203d = ho - lo_odiffbin:148rest.rfind('"')""One of four. The
rfindsite 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