[feature] Port Gamma Lake to a Rust core with Python bindings #63
All Vouch review confidence checks passed
Residual risk 0.28 = Change Risk (0.52) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #63"
general
weight: 0.35
timkpaine
Description
Replace the pure-Python storage engine with a Delta-backed Rust core exposed through PyO3.
The project now has two supported deliverables:
gamma_lakeRust crategamma-lakePython package with its Polars-facing APIThis intentionally does not introduce a standalone C/C++ API or native SDK.
Highlights
s3://), Azure (az://,abfss://) and GCS (gs://) Delta storageallow_new_index_values=Falserejects writes that would add index keysPublic APIs
GammaFeatureLakekeeps the 0.2 contract (Polars in, Polars/LazyFrame out).NativeLakeis the thin, lower-level wrapper over the Rust core. The differences are tabulated in [Native-Engine](docs/wiki/Native-Engine.md#gammafeaturelake-or-nativelake).Breaking changes
Full list in
CHANGELOG.mdanddocs/wiki/Migrating-from-0.2.md. Summary:GammaFeatureLakealways uses the Rust engine; therun_on_ray_clusterandiofields, the Ray execution path and therayextra are removed.model_copy(update=...)validates the update;DEFAULT_INDEX_SCHEMAis removed.delta_options=DeltaOptions(...).add_methods accept Polars DataFrames and returnNone; the third positional argument is nowoverlap_mode.us(sub-microsecond values raiseUnsupportedError); new time/duration features rejected; arrays stored as lists; categoricals stored as strings. Datetime, time and duration features that 0.2 stored as integers keep their types.ConflictError. Two writers adding the same new feature now record versions 0 and 1 instead of two version 0s.OSErrorsubclass); a lake constructed or used before a fork raisesRuntimeErrorin the child instead of hanging.Related issues
allow_new_index_valuescoversallow_new_index_rows.iomodule it changes is removed.Rollback behavior
Each row write is recorded in the append-only transaction log.
If a write fails after committing to one or more Delta tables, Gamma Lake identifies that write's commits by transaction ID and rolls them back while preserving unrelated writers' commits. If rollback cannot safely complete without removing another writer's changes, the transaction remains failed and raises
PartialWriteError.Review fixes in this round
1. Field assignment works again.
GammaFeatureLakeis no longer frozen. Assigning a field drops the cached core handle and revalidates against the new configuration, sofs.enable_runtime_computed_features = Trueworks as on main; main's six assignments intests/base.pyare restored. Assigning ormodel_copy(update=...)-ingcompression/target_file_sizemoves them intodelta_optionswith the deprecation warning, instead of being ignored.model_copy(update=...)validates the update.copy.copy,copy.deepcopyandmodel_copy(deep=True)work after the lake is used. As in 0.2, construction checksprimary_sort_keyagainst an existing index, andsort_keysisNonebeforeinitialize(). The deprecation warning points at the caller's line.2. Columns 0.2 stored as longs keep their types. 0.2 (through polars-io-tools) stored
ms/nsdatetimes, durations and times as Delta longs and recorded their Polars types in a[cpl.mapping]block of the table description; the parquetARROW:schemasaysint64. The Delta store restores those types from the snapshot it already loads, with no extra I/O. Scans cast them before filtering, so file pruning still applies. Appends, padding and merges write longs back. Copy-mode overlaps and consolidation record the types as 0.2 does, so 0.2 keeps reading them. A new compat scenario covers this: 0.2 writes, 0.3 appends, pads, merges, copies and consolidates, then 0.2 appends again.3. Concurrent writers adding different features all succeed again. A write that conflicts is rolled back and re-planned, up to 10 attempts. Between attempts it waits a random time of up to 50 ms, doubling up to 1 s, without holding the in-process write lock. This covers
add_,add_index_rows,annotate,consolidate_feature_groupsand runtime-feature registration. The reviewer's case of 4 processes, plus 8 and 16, now all succeed, with no duplicate keys and no misalignment. Each retry writes the data again.4. Wide writes are faster than main. About 80% of planning time was in SipHash
HashSets over every index and input key. Keys are now hashed in hash-partitioned groups on threads with foldhash, and unsorted input gets a parallel stable sample sort. Adding a new 4-feature group over a 1M-row index takes 0.23 s peradd_features, against 0.79 s before and 0.27 s on main. 16 groups take 3.8 s, against 12.8 s before and 4.3 s on main. Read checksums are identical on main, the old head and this head. There is a new ASV suite,GammaLakeFeatureGroupWriteSuite.5. CI configuration.
- Dependabot's first cargo entry is
directory: "/"again, so it no longer overlaps the/rustentry.-
deny.tomlignores RUSTSEC-2026-0543, -0555 and -0542 (unmaintainedchrono,chrono-tzandhumantime, which come in through arrow, datafusion, deltalake and object_store).-
urlis bumped to 2.5.9 for RUSTSEC-2026-0592, published 2026-11-20. That version percent-encodes^, so object store URLs containing^are now rejected, as spaces already were.6. Smaller items.
-
Error,Op,OverlapMode,SignalTypeand the option structs (LakeOptions,AddOptions,CreateOptions,DeltaOptions) are#[non_exhaustive]. Build options fromDefaultand set fields.- The docs now say which I/O failures raise
OSErrorsubclasses; most still raiseRuntimeError.- Sub-microsecond
np.datetime64bounds round down as 0.2 did, or stay exact on a nanosecond column.- The lazy-open and
stacklevelitems are covered in 1. On theD-unit correction: it is accepted, with no change.Integration review: one cross-commit issue was found and fixed. Nanosecond bounds on an index restored as
Datetime("ns")would have been rounded to µs.Earlier review fixes
RuntimeError.memory_limit, the index and up to 16 tables are prepared concurrently (16-group read: 0.264 s → 0.115 s locally); with a limit they are still sorted one at a time.DeltaOptionshides inputs (credentials) in validation errors.cargo deny check advisoriespasses; the remaining ignores are documented indeny.toml..gitignoreentries, unuseddatafusiondev-dependency and stray junit outputs removed.Release work (version bump, wheel platforms, conda-forge, third-party licenses, sdist contents) is left for a follow-up.
Type of Change
Checklist
make lint):make format && make lintpassedmake test):-
GAMMA_LAKE_OLD_SRC=$PWD/build/old-engine python -m pytest gammalake/tests -q: 335 passed, 0 skipped-
cd rust && cargo nextest run --workspace: 124 passed-
cargo test --doc --workspace: 2 passed-
cargo deny --manifest-path {Cargo.toml,rust/Cargo.toml} --all-features check advisories: ok for bothJira: CCRT-7507