Skip to content

Commit a07aa2e

Browse files
committed
feat(vortex-edition): session-registered editions validated by unit tests
Editions live on the session like encodings do: EditionSession is a session variable holding the per-session registry of editions and edition inclusions, populated explicitly at initialization time. EditionSession::default() seeds the first-party declarations — core2026.07.0 (a draft until its min_vortex_version is recorded, which is the act of freezing) and the 32 inclusions for the encodings the default writer emits — and any crate can declare further inclusions into a session, so declarations can migrate next to each encoding's registration. Declarations are plain constants (EditionId, Edition, EditionInclusion::new), with correctness enforced by unit tests rather than macros: EditionId::validate and EditionInclusion::validate check identifier and version forms, EditionSession::validate checks a whole registry (undeclared references, drafts-newest chronology, malformed versions, members requiring a release newer than their edition declares), and the validate!(CORE_2026_07_0) macro generates a unit test asserting an edition is well-formed, declared in the default session, and part of a valid registry. Everything else is computed: editions(), encodings_in(edition) (membership is inherited by later editions of the family), and current(family). The intended core2026.07.0 set is pinned by a golden test. Signed-off-by: Claude <noreply@anthropic.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdR42Svu74NcNzC7XJYwLr
1 parent 39f4abe commit a07aa2e

7 files changed

Lines changed: 912 additions & 0 deletions

File tree

Cargo.lock

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ members = [
88
"vortex-mask",
99
"vortex-utils",
1010
"vortex-session",
11+
"vortex-edition",
1112
"vortex-flatbuffers",
1213
"vortex-metrics",
1314
"vortex-io",
@@ -295,6 +296,7 @@ vortex-compute = { version = "0.1.0", path = "./vortex-compute", default-feature
295296
vortex-datafusion = { version = "0.1.0", path = "./vortex-datafusion", default-features = false }
296297
vortex-datetime-parts = { version = "0.1.0", path = "./encodings/datetime-parts", default-features = false }
297298
vortex-decimal-byte-parts = { version = "0.1.0", path = "encodings/decimal-byte-parts", default-features = false }
299+
vortex-edition = { version = "0.1.0", path = "./vortex-edition", default-features = false }
298300
vortex-error = { version = "0.1.0", path = "./vortex-error", default-features = false }
299301
vortex-fastlanes = { version = "0.1.0", path = "./encodings/fastlanes", default-features = false }
300302
vortex-file = { version = "0.1.0", path = "./vortex-file", default-features = false }

vortex-edition/Cargo.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[package]
2+
name = "vortex-edition"
3+
authors.workspace = true
4+
description = "Definitions of Vortex editions: named, frozen sets of encodings with a read-compatibility guarantee"
5+
edition = { workspace = true }
6+
homepage = { workspace = true }
7+
categories = { workspace = true }
8+
include = { workspace = true }
9+
keywords = { workspace = true }
10+
license = { workspace = true }
11+
readme = { workspace = true }
12+
repository = { workspace = true }
13+
rust-version = { workspace = true }
14+
version = { workspace = true }
15+
16+
[package.metadata.docs.rs]
17+
all-features = true
18+
19+
[lints]
20+
workspace = true
21+
22+
[dependencies]
23+
parking_lot = { workspace = true }
24+
vortex-session = { workspace = true }

vortex-edition/src/definitions.rs

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
// SPDX-FileCopyrightText: Copyright the Vortex contributors
3+
4+
//! The first-party edition declarations, seeded into
5+
//! [`EditionSession::default`](crate::EditionSession).
6+
//!
7+
//! Each block declares an edition together with the encodings that join the family at it;
8+
//! members of earlier editions are inherited and never restated. Correctness is enforced by
9+
//! unit tests: [`validate!`](crate::validate) covers each declared edition, and the
10+
//! computed set of a frozen edition is pinned by a golden test, so any change to these
11+
//! declarations that alters a frozen set fails CI. New encodings are staged into the newest
12+
//! draft edition. Declarations live centrally here for now; they are expected to migrate
13+
//! next to each encoding's registration.
14+
15+
use crate::Edition;
16+
use crate::EditionDeclaration;
17+
use crate::EditionId;
18+
19+
/// The first edition of the `core` family: the canonical encodings — the uncompressed
20+
/// representations every logical type decodes to. A draft until the release shipping it is
21+
/// published and its version is recorded.
22+
pub const CORE_2026_01_0: EditionId = EditionId::new("core", 2026, 1, 0);
23+
24+
/// The second `core` edition: inherits everything in [`CORE_2026_01_0`] and adds the
25+
/// container and compressed encodings the default file writer emits. A draft until the
26+
/// release shipping it is published and its version is recorded.
27+
pub const CORE_2026_07_0: EditionId = EditionId::new("core", 2026, 7, 0);
28+
29+
/// The first-party editions, each declared together with the encodings it adds.
30+
pub static DEFAULT_DECLARATIONS: &[EditionDeclaration] = &[
31+
EditionDeclaration {
32+
edition: Edition {
33+
id: CORE_2026_01_0,
34+
// TODO(editions): freeze by setting this to the first release shipping this
35+
// edition, once it is published.
36+
min_vortex_version: None,
37+
},
38+
added: &[
39+
&"vortex.null",
40+
&"vortex.bool",
41+
&"vortex.primitive",
42+
&"vortex.decimal",
43+
&"vortex.varbin",
44+
&"vortex.varbinview",
45+
&"vortex.list",
46+
&"vortex.listview",
47+
&"vortex.fixed_size_list",
48+
&"vortex.struct",
49+
&"vortex.variant",
50+
&"vortex.ext",
51+
],
52+
},
53+
EditionDeclaration {
54+
edition: Edition {
55+
id: CORE_2026_07_0,
56+
min_vortex_version: None,
57+
},
58+
added: &[
59+
&"vortex.chunked",
60+
&"vortex.constant",
61+
&"vortex.dict",
62+
&"vortex.masked",
63+
&"vortex.sparse",
64+
&"vortex.alp",
65+
&"vortex.alprd",
66+
&"vortex.bytebool",
67+
&"vortex.datetimeparts",
68+
&"vortex.decimal_byte_parts",
69+
&"vortex.fsst",
70+
&"vortex.pco",
71+
&"vortex.runend",
72+
&"vortex.sequence",
73+
&"vortex.zigzag",
74+
&"vortex.zstd",
75+
&"fastlanes.bitpacked",
76+
&"fastlanes.delta",
77+
&"fastlanes.for",
78+
&"fastlanes.rle",
79+
],
80+
},
81+
];

0 commit comments

Comments
 (0)