FAILURE MAP
← Case archive

FA-99391 / Embedding vector normalization / Open access

Gradient style clipping expands a vector already under the norm bound · case 01

Gradient style clipping expands a vector already under the norm bound.

Verified by executionVariant 1 · 6 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Every vector is rescaled to the bound, including vectors whose norm is already smaller.

THE FAILURE

Every vector is rescaled to the bound, including vectors whose norm is already smaller.

Unsuccessful approach: Clipping only the maximum coordinate ignores the Euclidean norm across coordinates.

Case contract

Return v scaled by min(1, bound/L2(v)); zero vectors stay zero and bound is positive.

Why this case matters

A small embedding preparation contract can be checked without a model or retrieval system.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(v, bound):
    length=sum(x*x for x in v)**0.5
    return [x*bound/length for x in v] if length else list(v)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('inside bound', solve([N,0],2*N), [N,0])
check('outside bound', solve([3*N,4*N],N), [3*N*(N/(5*N)),4*N*(N/(5*N))])
check('boundary', solve([N,0],N), [N,0])
check('zero', solve([0,0],N), [0,0])
check('coordinate cap insufficient', solve([N,N],N), [N*(N/(2*N*N)**0.5),N*(N/(2*N*N)**0.5)])
check('empty', solve([],N), [])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
inside bound[2.0, 0.0][1, 0]Failed
outside bound[0.6, 0.8][0.6000000000000001, 0.8]Failed
boundary[1.0, 0.0][1, 0]Passed
zero[0, 0][0, 0]Passed
coordinate cap insufficient[0.7071067811865475, 0.7071067811865475][0.7071067811865475, 0.7071067811865475]Passed
empty[][]Passed

SHA-256 / c81d8236896183bed0b65a65c7f5f530709dec7ad09c4139de0831f02b04888f

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(v, bound):
    return [max(-bound,min(bound,x)) for x in v]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('inside bound', solve([N,0],2*N), [N,0])
check('outside bound', solve([3*N,4*N],N), [3*N*(N/(5*N)),4*N*(N/(5*N))])
check('boundary', solve([N,0],N), [N,0])
check('zero', solve([0,0],N), [0,0])
check('coordinate cap insufficient', solve([N,N],N), [N*(N/(2*N*N)**0.5),N*(N/(2*N*N)**0.5)])
check('empty', solve([],N), [])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
inside bound[1, 0][1, 0]Passed
outside bound[1, 1][0.6000000000000001, 0.8]Failed
boundary[1, 0][1, 0]Passed
zero[0, 0][0, 0]Passed
coordinate cap insufficient[1, 1][0.7071067811865475, 0.7071067811865475]Failed
empty[][]Passed

SHA-256 / 7b416b2eca214ba745c2d198ceef84bf13a1c72b5ee7f8eeba8576ce61407415

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 6 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

Inputs are finite toy vectors or token rows; this contract makes no claim about model quality or production embedding behavior. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-30T16:48:23.555372+00:00.

Case digest / d408c9ed91839cfd7dba12d6a4e3ba9e7c7fce3c1e26e50670ecadce0a903191