feat[edition]: add enabled-editions selection to the session#8945
Conversation
Adds a required `Scheme::produced_encodings` method returning the array encodings a scheme may itself introduce into its compressed output. Cascaded children are compressed by other schemes, which declare their own encodings, so only encodings constructed directly by `compress` belong here. `BtrBlocksCompressorBuilder::retain_allowed_encodings` uses the declarations to drop any scheme that could produce an encoding outside a permitted set, so an encoding policy can be enforced before compression rather than rejected after it. Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
Introduces `EnabledEditions`, a session variable recording the editions a writer is permitted to emit — at most one per family, with a newer or older edition from the same family replacing the previous selection. This is deliberately separate from `EditionSession`: registration describes what a session knows how to reason about, while enabling is the explicit writer policy. `EditionSessionExt` gains: - `enabled_editions` — access the (lazily installed) selection. - `register_edition` / `enable_edition` — enabling an unregistered edition errors, so a typo or unavailable third-party declaration cannot silently produce an empty writable set. - `enabled_encoding_ids` — resolve the union of encodings across all enabled editions; empty when nothing is enabled. The default `vortex` session now enables the newest frozen `core` edition (and the newest unstable edition under `unstable_encodings`) via `editions::enable_default_editions`. No writer behavior changes yet: this only records the selection on the session. A follow-up PR consumes `enabled_encoding_ids` to gate the file writer. Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
Merging this PR will not alter performance
Comparing Footnotes
|
…s-session Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
Polar Signals Profiling ResultsLatest Run
Powered by Polar Signals Cloud |
Benchmarks: PolarSignals Profiling 📖Vortex (geomean): 1.015x ➖ How to read Verdict and Engines
datafusion / vortex-file-compressed (1.015x ➖, 0↑ 0↓)
No file size changes detected. |
Benchmarks: TPC-H SF=1 on NVME 📖Verdict: No clear signal (environment too noisy confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (1.013x ➖, 0↑ 0↓)
datafusion / vortex-compact (1.017x ➖, 0↑ 0↓)
datafusion / parquet (1.038x ➖, 0↑ 3↓)
datafusion / arrow (1.016x ➖, 0↑ 2↓)
duckdb / vortex-file-compressed (1.013x ➖, 0↑ 0↓)
duckdb / vortex-compact (1.009x ➖, 0↑ 0↓)
duckdb / parquet (0.991x ➖, 2↑ 2↓)
duckdb / duckdb (1.006x ➖, 0↑ 0↓)
No file size changes detected. |
Benchmarks: FineWeb NVMe 📖Verdict: No clear signal (low confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (1.070x ➖, 0↑ 2↓)
datafusion / vortex-compact (1.123x ❌, 0↑ 6↓)
datafusion / parquet (1.021x ➖, 0↑ 2↓)
duckdb / vortex-file-compressed (1.153x ❌, 0↑ 5↓)
duckdb / vortex-compact (1.120x ❌, 0↑ 7↓)
duckdb / parquet (1.089x ➖, 0↑ 5↓)
No file size changes detected. |
Benchmarks: Vortex queries 📖Verdict: No clear signal (low confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (0.884x ✅, 2↑ 0↓)
datafusion / parquet (0.928x ➖, 0↑ 0↓)
duckdb / vortex-file-compressed (0.963x ➖, 0↑ 0↓)
duckdb / parquet (0.938x ➖, 0↑ 0↓)
No file size changes detected. |
Benchmarks: TPC-DS SF=1 on NVME 📖Verdict: No clear signal (low confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (1.058x ➖, 0↑ 18↓)
datafusion / vortex-compact (1.065x ➖, 0↑ 19↓)
datafusion / parquet (1.045x ➖, 0↑ 12↓)
duckdb / vortex-file-compressed (1.053x ➖, 0↑ 15↓)
duckdb / vortex-compact (1.035x ➖, 1↑ 4↓)
duckdb / parquet (1.030x ➖, 2↑ 1↓)
duckdb / duckdb (1.036x ➖, 0↑ 3↓)
No file size changes detected. |
Benchmarks: FineWeb S3 📖Verdict: No clear signal (low confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (0.975x ➖, 0↑ 0↓)
datafusion / vortex-compact (0.975x ➖, 0↑ 0↓)
datafusion / parquet (0.999x ➖, 0↑ 0↓)
duckdb / vortex-file-compressed (1.043x ➖, 0↑ 0↓)
duckdb / vortex-compact (1.004x ➖, 0↑ 0↓)
duckdb / parquet (1.016x ➖, 0↑ 0↓)
|
Benchmarks: Statistical and Population Genetics 📖Verdict: No clear signal (low confidence) How to read Verdict and Engines
duckdb / vortex-file-compressed (0.998x ➖, 0↑ 0↓)
duckdb / vortex-compact (0.996x ➖, 0↑ 0↓)
duckdb / parquet (0.987x ➖, 0↑ 0↓)
No file size changes detected. |
Benchmarks: Clickbench Sorted on NVME 📖Verdict: No clear signal (low confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (1.016x ➖, 0↑ 1↓)
datafusion / parquet (0.944x ➖, 2↑ 0↓)
duckdb / vortex-file-compressed (0.986x ➖, 0↑ 1↓)
duckdb / parquet (0.992x ➖, 0↑ 0↓)
duckdb / duckdb (0.975x ➖, 0↑ 0↓)
File Size Changes (201 files changed, -0.0% overall, 107↑ 94↓)
Totals:
|
Benchmarks: TPC-H SF=10 on NVME 📖Verdict: No clear signal (low confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (0.762x ✅, 22↑ 0↓)
datafusion / vortex-compact (0.776x ✅, 22↑ 0↓)
datafusion / parquet (0.802x ✅, 21↑ 0↓)
datafusion / arrow (0.770x ✅, 22↑ 0↓)
duckdb / vortex-file-compressed (0.804x ✅, 22↑ 0↓)
duckdb / vortex-compact (0.820x ✅, 22↑ 0↓)
duckdb / parquet (0.893x ✅, 14↑ 0↓)
duckdb / duckdb (0.862x ✅, 20↑ 0↓)
No file size changes detected. |
Benchmarks: TPC-H SF=1 on S3 📖Verdict: No clear signal (environment too noisy confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (1.000x ➖, 0↑ 0↓)
datafusion / vortex-compact (1.052x ➖, 0↑ 2↓)
datafusion / parquet (1.052x ➖, 0↑ 2↓)
duckdb / vortex-file-compressed (1.039x ➖, 0↑ 0↓)
duckdb / vortex-compact (0.983x ➖, 0↑ 0↓)
duckdb / parquet (0.986x ➖, 0↑ 0↓)
|
Benchmarks: Clickbench on NVME 📖Verdict: No clear signal (low confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (1.066x ➖, 0↑ 16↓)
datafusion / parquet (1.052x ➖, 0↑ 13↓)
duckdb / vortex-file-compressed (1.059x ➖, 0↑ 15↓)
duckdb / parquet (1.081x ➖, 0↑ 18↓)
duckdb / duckdb (1.066x ➖, 0↑ 15↓)
File Size Changes (1 files changed, -0.0% overall, 0↑ 1↓)
Totals:
|
Benchmarks: Random Access 📖Vortex (geomean): 1.036x ➖ How to read Verdict and Engines
unknown / unknown (1.051x ➖, 1↑ 13↓)
|
Benchmarks: Appian on NVME 📖Verdict: No clear signal (low confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (0.990x ➖, 0↑ 0↓)
datafusion / parquet (0.992x ➖, 0↑ 0↓)
duckdb / vortex-file-compressed (1.002x ➖, 0↑ 0↓)
duckdb / parquet (1.000x ➖, 0↑ 0↓)
duckdb / duckdb (1.003x ➖, 0↑ 0↓)
File Size Changes (1 files changed, -0.0% overall, 0↑ 1↓)
Totals:
|
Benchmarks: TPC-H SF=10 on S3 📖Verdict: No clear signal (low confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (1.033x ➖, 0↑ 0↓)
datafusion / vortex-compact (1.002x ➖, 0↑ 0↓)
datafusion / parquet (1.003x ➖, 0↑ 0↓)
duckdb / vortex-file-compressed (0.968x ➖, 0↑ 0↓)
duckdb / vortex-compact (0.951x ➖, 0↑ 0↓)
duckdb / parquet (1.026x ➖, 0↑ 0↓)
|
Benchmarks: Compression 📖Vortex (geomean): 0.991x ➖ How to read Verdict and Engines
unknown / unknown (0.976x ➖, 10↑ 0↓)
|
|
@claude review |
|
Claude encountered an error after 2s —— View job I'll analyze this and get back to you. |
0ax1
left a comment
There was a problem hiding this comment.
Looks good but we can prob make the data structure more lightweight.
| /// explicit writer policy. | ||
| #[derive(Clone, Debug, Default)] | ||
| pub struct EnabledEditions { | ||
| inner: Arc<RwLock<BTreeMap<&'static str, EditionId>>>, |
There was a problem hiding this comment.
Seems quite heavy as a data structure.
| /// [`register_default_editions`]. | ||
| pub fn enable_default_editions(session: &VortexSession) { | ||
| session | ||
| .enable_edition(DEFAULT_CORE_EDITION) |
There was a problem hiding this comment.
Should this be an enum, or constants?
There was a problem hiding this comment.
I don't think so here
| assert!(core_only.iter().all(|id| both.contains(id))); | ||
| } | ||
|
|
||
| #[test] |
There was a problem hiding this comment.
anything specific you thin im missing?
Summary
Introduces
EnabledEditions, a session variable recording the editions a writer is permitted to emit — at most one per family, with a newer or older edition from the same family replacing the previous selection. This is deliberately separate fromEditionSession: registration describes what a session knows how to reason about, while enabling is the explicit writer policy.This is the second of three stacked PRs. It only records the selection on the session; no writer behavior changes yet. The follow-up consumes
enabled_encoding_idsto gate the file writer.Changes
EditionSessionExtgains:enabled_editions— access the (lazily installed) selection.register_edition/enable_edition— enabling an unregistered edition errors, so a typo or unavailable third-party declaration cannot silently produce an empty writable set.enabled_encoding_ids— resolve the union of encodings across all enabled editions; empty when nothing is enabled.The default
vortexsession now enables the newest frozencoreedition (and the newest unstable edition underunstable_encodings) viaeditions::enable_default_editions.