Skip to content

Commit 803a3dc

Browse files
authored
Replace normalized encoding with explicit normalization (#9767)
## Summary - Tracking Issue: #6865 Replaces the `Normalized` physical encoding with an explicit `L2Normalize` scalar function. `L2Norm` returns only the magnitude, while `L2Normalize` returns a struct containing the normalized value and the same norm. ## Changes Computes normalization in one pass with the same left-to-right norm kernel used by `L2Norm`. Removes encoding-specific L2 norm, inner-product, and cosine shortcuts so these operations always derive results from decoded coordinates. Tests cover vectors, tensors, nulls, zero rows, `f16`, non-finite values, overflow, underflow, persistence, and bitwise agreement between both norm results. ## API Changes Removes the public `Normalized` encoding and compression scheme. Adds `L2Normalize`, whose output is a nullable struct with non-nullable `normalized` and `norm` fields. Signed-off-by: Connor Tsui <[email protected]>
1 parent 5c8c397 commit 803a3dc

22 files changed

Lines changed: 620 additions & 2742 deletions

File tree

‎docs/specs/editions.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ This edition currently adds no components.
367367
#### `tensor2026.04.0`
368368

369369
- `array`: `vortex.tensor.cosine_similarity`, `vortex.tensor.inner_product`, `vortex.tensor.l2_norm`,
370-
`vortex.tensor.normalized`
370+
`vortex.tensor.l2_normalize`
371371
- `dtype`: `vortex.tensor.fixed_shape_tensor`, `vortex.tensor.vector`
372372

373373
#### `zstd2026.02.0`

‎vortex-tensor/Cargo.toml‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ harness = false
4848
name = "l2_norm"
4949
harness = false
5050

51-
[[bench]]
52-
name = "normalized"
53-
harness = false
54-
5551
[[bench]]
5652
name = "inner_product"
5753
harness = false

‎vortex-tensor/benches/normalized.rs‎

Lines changed: 0 additions & 138 deletions
This file was deleted.

‎vortex-tensor/src/editions.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub static DECLARATION: EditionDeclaration = EditionDeclaration {
3434
EditionMember::array(&"vortex.tensor.cosine_similarity"),
3535
EditionMember::array(&"vortex.tensor.inner_product"),
3636
EditionMember::array(&"vortex.tensor.l2_norm"),
37-
EditionMember::array(&"vortex.tensor.normalized"),
37+
EditionMember::array(&"vortex.tensor.l2_normalize"),
3838
EditionMember::dtype(&"vortex.tensor.fixed_shape_tensor"),
3939
EditionMember::dtype(&"vortex.tensor.vector"),
4040
],

‎vortex-tensor/src/encodings/mod.rs‎

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)