From 5a17a77748f28f8beb1d5ad290817b8077d7aa0a Mon Sep 17 00:00:00 2001 From: Vyncint Ng <115854244+vyncint@users.noreply.github.com> Date: Wed, 18 Nov 2026 17:08:13 +0700 Subject: [PATCH 1/6] docs(roadmap): tick what 0.3.0 closed in Phase 8, with the T4 evidence #28, #29, #45 and #46 ran on a Tesla T4 on 2026-11-18 before they merged; the chain bump (#40) retired the thrift advisory (#4, #54); #31 landed with #148's fail-fast. Three lines remain: double-buffered transfers, TLS for the cluster ports (#30, whose private-network half shipped) and a runner for gpu.yml (#38). Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com> --- docs/roadmap.md | 90 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 66 insertions(+), 24 deletions(-) diff --git a/docs/roadmap.md b/docs/roadmap.md index be06c4d..6b2bcea 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -111,7 +111,7 @@ Acceptance - [x] `RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps` clean - [x] Gate green -## Phase 8 — production readiness (milestone `v0.2.0`) +## Phase 8 — production readiness (milestones `v0.2.0` and `v0.3.0`) Phases 0–7 were the build. This is the list that stands between the published 0.1.x and something to run in production, and it is the one @@ -132,6 +132,22 @@ Ten lines remain, and the three that matter most cannot be closed here: #28, what #25's real wiring waits for. Do not read 0.2.0 as "production ready"; read it as "a running deployment can now tell whether its GPU is being used". +**0.3.0 closed seven more**, and with them every line that waited for a CUDA +device: +- #28, #45 and #46 ran on a Tesla T4 on 2026-11-18, before they merged. So + did #29's streaming aggregate. +- The chain bump (#40) retired the thrift advisory (#4, #54). +- Worker loss and `SIGTERM` are handled (#31). A lost worker fails its query + rather than risk Ballista 55's rollback (#148). + +Three lines remain: +- Double-buffered transfers (P6-rest). +- TLS for the cluster ports (#30). Its enforced private-network half shipped. +- A `gpu` runner for `gpu.yml` (#38). + +A cluster still belongs on a private network, behind an authenticating proxy +for anything beyond it. + ### Correctness - [x] io_uring worker reaps its CQE before returning (#27) — *Acceptance:* a @@ -145,20 +161,28 @@ read it as "a running deployment can now tell whether its GPU is being used". - [x] `oxide sql` survives a closed pipe (#34) — *Acceptance:* `… | head -1` exits 0 with no panic, on an output larger than a pipe buffer. **0.1.4** -- [ ] CUDA filter matches Arrow totalOrder float comparison (#28) — +- [x] CUDA filter matches stock DataFusion's float comparison (#28) — *Acceptance:* NaN and `-0.0` rows in the conformance suite agree with - stock DataFusion on a CUDA device. -- [ ] `GpuAggregateExec` streams and partitions instead of collecting the - whole input (#29, audit P4) — *Acceptance:* a input larger than device - memory completes. Both halves are in 0.3.0: each input partition is - aggregated on its own (#90), and a device is handed one batch at a - time while the operator keeps one accumulator per group (#29). Not yet - run on a GPU. -- [ ] `SUM(Int64)` wraps on overflow on every backend, as stock DataFusion's + stock DataFusion on a CUDA device. `special_floats` passed on a Tesla + T4 (2026-11-18). The line first said Arrow's totalOrder, which was + DataFusion 54's order. DataFusion 55 reads `-0.0` as `+0.0` in a + comparison and orders the rest by totalOrder, and the device follows + DataFusion. **0.3.0** +- [x] `GpuAggregateExec` streams and partitions instead of collecting the + whole input (#29, audit P4) — *Acceptance:* an input larger than device + memory completes. Each input partition is aggregated on its own (#90). + The device is handed one batch at a time while the operator keeps one + accumulator per group (#29): on the T4 (2026-11-18), 10M rows took 153 + device calls. The acceptance holds by construction: the device never + holds more than one batch. No input larger than the T4's memory was + run. **0.3.0** +- [x] `SUM(Int64)` wraps on overflow on every backend, as stock DataFusion's does (#46) — *Acceptance:* the conformance overflow fixture equals DataFusion's wrapped answer on a CUDA device. The line first asked for an error, on the premise that DataFusion raises one; it wraps, so the - CPU reference was the outlier and now wraps too (#100). + CPU reference was the outlier and now wraps too (#100). On a Tesla T4 + (2026-11-18), `aggregate_wraps_int64_sums_like_the_reference` and the + conformance aggregate checks pass. **0.3.0** - [x] `SpillManager` and `MemoryInfo` reach the operators, or the docs and the TUI say they are library-only (#25) — *closed the second way*: tier capacities come from the backend's `MemoryInfo`, and the panel, @@ -173,13 +197,18 @@ read it as "a running deployment can now tell whether its GPU is being used". measurement and the change are Phase 9. **0.1.4** - [ ] Double-buffered stream pipelines (audit P6-rest) — *Acceptance:* transfer and compute overlap for a multi-batch scan, measured. -- [ ] CUDA join table persists across probe batches (#45) — *Acceptance:* - the build side is uploaded once per join, not once per batch. The - join half is in 0.3.0 (`GpuBackend::prepare_join_build`, compiled and - not yet run on a GPU), and so is the aggregate half: a batch's groups - are numbered on the device, so its accumulators and what is read back - hold one entry per group rather than two per row (compiled, and checked - on the CPU under a shim of the CUDA builtins; not yet run on a GPU). +- [x] CUDA join table persists across probe batches (#45) — *Acceptance:* + the build side is uploaded once per join, not once per batch. + - **Join half:** `GpuBackend::prepare_join_build` indexes the build side + once per operator. + - **Aggregate half:** a batch's groups are numbered on the device, so + its accumulators, and what is read back, hold one entry per group + rather than two per row. + - **On a Tesla T4 (2026-11-18):** both passed the conformance joins + (the chunked one included), `join_timing`, + `aggregate_numbers_groups_like_the_reference` and `aggregate_timing`. + + **0.3.0** - [x] io_uring store wired into sessions, or the claim stays demoted (#24, audit P12) — *the claim stays demoted*: no session constructs it, and every document says so. **0.1.4** @@ -196,11 +225,20 @@ read it as "a running deployment can now tell whether its GPU is being used". `INFO` line per query from `OxideSession::collect`, and `--metrics-port` on the worker and scheduler behind the `metrics` feature. **0.2.0** -- [ ] Worker loss, Ballista retry settings and `SIGTERM` handling (#31, - audit P13). +- [x] Worker loss, Ballista retry settings and `SIGTERM` handling (#31, + audit P13): + - Scheduler and worker drain on `SIGTERM` within `--drain-timeout`. + - Ballista's retry and timeout limits are flags. + - A query that loses a worker fails, naming it, rather than risk Ballista + 55's rollback, which can return rows twice. This holds until a Ballista + release carries apache/datafusion-ballista#2677 (#148). + + **0.3.0** - [ ] TLS/auth for cluster mode, or an enforced private-network posture (#30) — *Acceptance:* the production cluster instructions do not - describe an unauthenticated listener. + describe an unauthenticated listener. 0.3.0 enforces the private-network + half: both binaries refuse a public or wildcard address unless given + `--allow-insecure-bind`. TLS is still open. - [x] Plan codec version fingerprint, failing fast on mixed builds (#42). **0.2.0** - [x] `--batch-size`, `--output table|json|csv`, worker `--backend` (#49) — @@ -213,13 +251,17 @@ read it as "a running deployment can now tell whether its GPU is being used". ### Supply chain and release -- [ ] Ballista 55 / DataFusion 55 / arrow 59 chain bump (#40) — blocks #4 - and #54. -- [ ] thrift advisory retired once parquet ≥ 59 lands (#4, #54). +- [x] Ballista 55 / DataFusion 55 / arrow 59 chain bump (#40). **0.3.0** +- [x] thrift advisory retired: parquet 59 has no `thrift` (#4, #54). + **0.3.0** - [x] Public enums `non_exhaustive`, DataFusion-coupling semver policy written (#41) — landed in a minor, with the plan vocabulary left exhaustive on purpose. **0.2.0** - [ ] On-demand CUDA execution job, made a release prerequisite (#38). + `gpu.yml` and `make test-cuda-device` are in 0.3.0, and + `docs/RELEASING.md` step 0 asks for them. No runner is registered, so + the job has never run; 0.3.0's CUDA paths ran in a manual T4 session + instead. - [x] CI build-cache policy decided and documented (#39). **0.1.4** - [x] termlens-cli installed prebuilt in CI (#48). **0.1.4** - [x] README, STATUS and CHANGELOG agree on CUDA execution and the From 6cd9d4d2bcd2a17be3db33baa47a7ad1d92fb475 Mon Sep 17 00:00:00 2001 From: Vyncint Ng <115854244+vyncint@users.noreply.github.com> Date: Wed, 18 Nov 2026 17:11:26 +0700 Subject: [PATCH 2/6] docs: record the 2026-11-18 T4 session where the CUDA record is quoted gpu.yml, docs/RELEASING.md step 0, the test-cuda-device comment and the README's CUDA line named the 2026-09-06 session as the only device run. 0.3.0's CUDA changes ran on a T4 on 2026-11-18, on the fix branches before they merged. RELEASING now asks a release with no gpu runner to say exactly what ran (ADR-0012) rather than only 'compiled-only'. Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com> --- .github/workflows/gpu.yml | 5 +++-- Makefile | 3 ++- README.md | 2 +- docs/RELEASING.md | 11 +++++++---- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/gpu.yml b/.github/workflows/gpu.yml index 1bb030d..6454838 100644 --- a/.github/workflows/gpu.yml +++ b/.github/workflows/gpu.yml @@ -3,9 +3,10 @@ # Nothing else here executes CUDA code. ci.yml runs on hosted runners with # no GPU, so the `cuda` feature is compiled and linted there (`make # check-cuda`, `make lint-cuda`) and every test that needs a device is -# #[ignore]d. The only CUDA execution on record is the manual T4 session of +# #[ignore]d. The only CUDA executions on record are two manual T4 sessions: # 2026-09-06, which found a correctness bug in the aggregation kernel that -# 3 seeds x 5 sizes of CPU conformance had not (STATUS.md). "Compiles with +# 3 seeds x 5 sizes of CPU conformance had not, and 2026-11-18, which ran +# 0.3.0's CUDA changes before they merged (STATUS.md). "Compiles with # --features cuda" is not a verification status; this is how a release # candidate gets one. docs/RELEASING.md step 0 requires it. # diff --git a/Makefile b/Makefile index 215e2f2..faf2acd 100644 --- a/Makefile +++ b/Makefile @@ -138,7 +138,8 @@ check-cuda: ## the GPU compile gate: cuda code builds with no CUDA installed # Not part of `make gate`: it executes CUDA, so it needs an NVIDIA GPU, its # driver and NVRTC, which no gate machine and no hosted runner has. gpu.yml # runs it on demand on a self-hosted runner labelled `gpu` (#38). The three -# suites are the ones the 2026-09-06 T4 session ran (STATUS.md). Unlike +# suites are ones the T4 sessions of 2026-09-06 and 2026-11-18 ran +# (STATUS.md). Unlike # test-metal-device it fails, never skips, without a device: its whole # purpose is execution, and a skip would be a green run that executed # nothing. OXIDE_BACKEND=cuda makes the detector refuse to fall back to the diff --git a/README.md b/README.md index 0fe3792..3017f09 100644 --- a/README.md +++ b/README.md @@ -164,7 +164,7 @@ cargo check -p oxidelake-runtime --features cuda # Metal (macOS): the conformance suite executes on the device cargo test -p oxidelake-compute --features metal -- --ignored -# On a CUDA machine (run on a T4 since 2026-09-06; see STATUS.md): +# On a CUDA machine (run on a T4 on 2026-09-06 and 2026-11-18; see STATUS.md): OXIDE_BACKEND=cuda cargo test -p oxidelake-compute --features cuda -- --ignored ``` diff --git a/docs/RELEASING.md b/docs/RELEASING.md index f663daf..40b7278 100644 --- a/docs/RELEASING.md +++ b/docs/RELEASING.md @@ -49,14 +49,17 @@ Trusted Publishing. ```sh # 0. Green main, and no flakes: run the stress workflow and wait for it. gh workflow run stress.yml && gh run watch -# Then execute CUDA on the same commit: CI only compiles it, and the one -# device run on record (2026-09-06, T4) found a kernel bug that CPU +# Then execute CUDA on the same commit: CI only compiles it, and the +# first device run (2026-09-06, T4) found a kernel bug that CPU # conformance had passed. gpu.yml runs `make test-cuda-device` on the # self-hosted `gpu` runner. Required: put the run's GPU, driver and commit # in STATUS.md's matrix in the release PR (step 3). release.yml does not # check this; the checklist is the gate. With no `gpu` runner (the case -# until one is registered), the release PR and the release notes say the -# CUDA paths of this release are compiled-only, as ADR-0012 requires. +# until one is registered), the release PR and the release notes say +# exactly what did run, as ADR-0012 requires: a manual device session on +# the release's changes (0.3.0: a T4 on 2026-11-18, on the fix branches +# before they merged, not on the tagged commit), or, with none, that the +# CUDA paths of this release are compiled-only. gh workflow run gpu.yml --ref main && gh run watch # 1. Bump `version` in the workspace [workspace.package] AND every internal From 68b169aa4ab251bcc1730744648d971664e1951c Mon Sep 17 00:00:00 2001 From: Vyncint Ng <115854244+vyncint@users.noreply.github.com> Date: Wed, 18 Nov 2026 17:39:09 +0700 Subject: [PATCH 3/6] release: bump the workspace to 0.3.0 [workspace.package] and every internal version in [workspace.dependencies]; the lockfile's nine oxidelake entries follow. Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com> --- Cargo.lock | 18 +++++++++--------- Cargo.toml | 20 ++++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6d091bc..a6d5b77 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3585,7 +3585,7 @@ dependencies = [ [[package]] name = "oxidelake-api" -version = "0.2.0" +version = "0.3.0" dependencies = [ "datafusion", "oxidelake-core", @@ -3597,7 +3597,7 @@ dependencies = [ [[package]] name = "oxidelake-compute" -version = "0.2.0" +version = "0.3.0" dependencies = [ "arrow", "datafusion", @@ -3615,7 +3615,7 @@ dependencies = [ [[package]] name = "oxidelake-core" -version = "0.2.0" +version = "0.3.0" dependencies = [ "datafusion", "serde", @@ -3624,7 +3624,7 @@ dependencies = [ [[package]] name = "oxidelake-device" -version = "0.2.0" +version = "0.3.0" dependencies = [ "arrow", "cudarc", @@ -3639,7 +3639,7 @@ dependencies = [ [[package]] name = "oxidelake-memory" -version = "0.2.0" +version = "0.3.0" dependencies = [ "arrow", "bytes", @@ -3656,7 +3656,7 @@ dependencies = [ [[package]] name = "oxidelake-planner" -version = "0.2.0" +version = "0.3.0" dependencies = [ "arrow", "datafusion", @@ -3672,7 +3672,7 @@ dependencies = [ [[package]] name = "oxidelake-runtime" -version = "0.2.0" +version = "0.3.0" dependencies = [ "anyhow", "arrow", @@ -3702,7 +3702,7 @@ dependencies = [ [[package]] name = "oxidelake-storage" -version = "0.2.0" +version = "0.3.0" dependencies = [ "arrow", "async-trait", @@ -3722,7 +3722,7 @@ dependencies = [ [[package]] name = "oxidelake-tui" -version = "0.2.0" +version = "0.3.0" dependencies = [ "crossterm", "insta", diff --git a/Cargo.toml b/Cargo.toml index b6bbbf6..405fb08 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ resolver = "2" members = ["crates/*"] [workspace.package] -version = "0.2.0" +version = "0.3.0" edition = "2024" # The lockfile's floor (Ballista's bundled AWS SDK crates need 1.94.1; the # chain itself declares 1.94.0), not the direct dependencies'; verified by @@ -25,15 +25,15 @@ exclude = [".github/*", ".claude/*", "docs/*", "target/*"] [workspace.dependencies] # internal crates -oxidelake-core = { path = "crates/oxidelake-core", version = "0.2.0" } -oxidelake-memory = { path = "crates/oxidelake-memory", version = "0.2.0" } -oxidelake-device = { path = "crates/oxidelake-device", version = "0.2.0" } -oxidelake-compute = { path = "crates/oxidelake-compute", version = "0.2.0" } -oxidelake-storage = { path = "crates/oxidelake-storage", version = "0.2.0" } -oxidelake-planner = { path = "crates/oxidelake-planner", version = "0.2.0" } -oxidelake-runtime = { path = "crates/oxidelake-runtime", version = "0.2.0" } -oxidelake-tui = { path = "crates/oxidelake-tui", version = "0.2.0" } -oxidelake-api = { path = "crates/oxidelake-api", version = "0.2.0" } +oxidelake-core = { path = "crates/oxidelake-core", version = "0.3.0" } +oxidelake-memory = { path = "crates/oxidelake-memory", version = "0.3.0" } +oxidelake-device = { path = "crates/oxidelake-device", version = "0.3.0" } +oxidelake-compute = { path = "crates/oxidelake-compute", version = "0.3.0" } +oxidelake-storage = { path = "crates/oxidelake-storage", version = "0.3.0" } +oxidelake-planner = { path = "crates/oxidelake-planner", version = "0.3.0" } +oxidelake-runtime = { path = "crates/oxidelake-runtime", version = "0.3.0" } +oxidelake-tui = { path = "crates/oxidelake-tui", version = "0.3.0" } +oxidelake-api = { path = "crates/oxidelake-api", version = "0.3.0" } # data plane — Ballista 55 is the root of this chain ballista = "55" # client: SessionContext::remote / standalone From 3cddc5cdb0e9110dab813d720f4549658172f5bb Mon Sep 17 00:00:00 2001 From: Vyncint Ng <115854244+vyncint@users.noreply.github.com> Date: Wed, 18 Nov 2026 17:42:35 +0700 Subject: [PATCH 4/6] docs: STATUS and README for 0.3.0 STATUS: the header describes 0.3.0; the matrix records the 2026-11-18 T4 session (on the fix branches before they merged, not the tagged commit) in the CUDA kernel, hash join, aggregation and operator rows, which moved out of the compiled-only and needs-GPU columns; a Known limitations section names #142 (NaN pruning, apache/datafusion#15812) and #148 (Ballista 55's lost-worker rollback) with their workarounds; two decision bullets that later ones superseded (cudarc without the NVRTC probe, spill accounting before #116) are gone. README: the status line describes 0.3.0. Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com> --- README.md | 6 +++++- STATUS.md | 35 +++++++++++++++++++++++++---------- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 3017f09..accb585 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,11 @@ A GPU-accelerated, Arrow-native distributed analytical query engine, written in Rust. It reads and writes Parquet on object storage; a catalog, a metastore and transactions are out of scope, so it is a query engine over a lake rather than a lakehouse in the full sense. -**Status: internal phases 0–7 complete; published 0.2.0. Production readiness is milestone v0.2.0, and 0.2.0 did not finish it** — ten [Phase 8](https://github.com/vyncint/oxidelake/blob/main/docs/roadmap.md) lines remain open, three of them needing a CUDA device to verify on. What 0.2.0 does add is the ability to tell what a deployment is actually doing: a CPU-fallback counter, placement notes under `oxide explain`, query spans, a per-query log line and a Prometheus endpoint. The default build is pure CPU and the whole gate is green on Linux x86_64 and macOS arm64. Both GPU backends have executed on real hardware: **Metal** on Apple silicon (conformance-tested against stock DataFusion on an M4 Pro) and **CUDA** on an NVIDIA T4 since 2026-09-06, where every kernel was NVRTC-compiled and launched — and where a correctness bug in the aggregation kernel was found. [STATUS.md](https://github.com/vyncint/oxidelake/blob/main/STATUS.md) holds the verification matrix, component by component, and is the ledger ADR-0012 makes it. The specification the engine was built to is [docs/SPEC.md](https://github.com/vyncint/oxidelake/blob/main/docs/SPEC.md). +**Status: internal phases 0–7 complete; published 0.3.0, the correctness release.** It moves to Ballista 55, DataFusion 55.2 and arrow 59, and fixes everything a review of the whole engine found. Among those findings: places where GPU placement could change a query's result, files that could panic the engine, and a cluster that now fails a query on a lost worker rather than risk Ballista 55's rollback. Three [Phase 8](https://github.com/vyncint/oxidelake/blob/main/docs/roadmap.md) lines remain open: double-buffered transfers, TLS for the cluster ports, and a runner for the on-demand CUDA job. The default build is pure CPU, and the whole gate is green on Linux x86_64 and macOS arm64. Both GPU backends have executed on real hardware: +- **Metal** on Apple silicon, conformance-tested against stock DataFusion on an M4 Pro. +- **CUDA** on an NVIDIA T4: + - on 2026-09-06, where every kernel was NVRTC-compiled and launched, and a correctness bug in the aggregation kernel was found; + - again on 2026-11-18, for every CUDA change in 0.3.0. [STATUS.md](https://github.com/vyncint/oxidelake/blob/main/STATUS.md) holds the verification matrix, component by component, and is the ledger ADR-0012 makes it. The specification the engine was built to is [docs/SPEC.md](https://github.com/vyncint/oxidelake/blob/main/docs/SPEC.md). ## Install diff --git a/STATUS.md b/STATUS.md index 0c4d5f5..ac351c7 100644 --- a/STATUS.md +++ b/STATUS.md @@ -1,6 +1,6 @@ # Status -_Last updated: 2026-09-21 — **Internal phases 0–7 done; published 0.2.0 (2026-09-21). Production readiness is milestone v0.2.0, which 0.2.0 did not finish: ten Phase 8 lines remain open.** "v1 complete" below and in earlier notes means the internal phase plan of `docs/SPEC.md`, not a 1.0 release; the published version is the one in `Cargo.toml`. 0.2.0 is the observability release — a CPU-fallback counter and placement notes (#32), query spans, a per-query log line and a Prometheus endpoint (#33), the plan-codec fingerprint (#42), the CLI knobs (#49), `predict`'s activation header (#47, which also found that the loader applied no activation at all), the `non_exhaustive` policy (#41), and an honest account of the spill manager's scope (#25). 0.1.4 fixed three correctness bugs — an io_uring use-after-free (#27), ignored `GetOptions` preconditions (#44) and a panic on a closed pipe (#34) — and makes the README, SPEC and roadmap say what the code actually does. The repository moved to `vyncint/oxidelake` as a public project with a single-commit history (the private development history is `vyncint/oxidelake-old`); crates were renamed `oxide-*` → `oxidelake-*` because two of the old names were taken on crates.io, and the GPU kernel sources moved inside `oxidelake-device` so the published crate is self-contained (ADR-0016). Development moved from the Linux CPU box to a macOS machine (Apple M4 Pro, 24 GiB unified memory, Metal 4, Rust 1.98.0), where the whole default gate re-ran green and the Metal backend compiles, lints and **executes**; since 2026-09-06 an AWS `g4dn.xlarge` (NVIDIA Tesla T4) has executed the **CUDA** path too. Both GPU backends have now run on real hardware — the matrix below says which rows that covers. What stands between this and something to run in production is **Phase 8** of [docs/roadmap.md](docs/roadmap.md), milestone `v0.2.0`, which lists every open issue with what would close it._ +_Last updated: 2026-11-18 — **Internal phases 0–7 done; published 0.3.0 (2026-11-18).** "v1 complete" below and in earlier notes means the internal phase plan of `docs/SPEC.md`, not a 1.0 release; the published version is the one in `Cargo.toml`. 0.3.0 is the correctness release. The dependency chain moved to Ballista 55, DataFusion 55.2 and arrow 59 (#40); parquet 59 retired the thrift advisory (#4, #54). A review of the whole engine found 47 defects (#86–#132), and fixing them turned up two more (#133, #134). Among them: GPU placement could change a query's result, malformed files could panic, and the Ballista 55 move (never released) left a cluster running no GPU operator at all. All of them are fixed, together with #28, #29, #31, #45 and #46 from Phase 8. Every CUDA change ran on an NVIDIA T4 on 2026-11-18 before it merged. A cluster fails a query that loses a worker rather than risk Ballista 55's rollback (#148, see [Known limitations](#known-limitations)). 0.2.0 was the observability release: a CPU-fallback counter and placement notes, query spans, a Prometheus endpoint and the plan-codec fingerprint. 0.1.4 fixed an io_uring use-after-free, ignored `GetOptions` preconditions and a panic on a closed pipe. The repository moved to `vyncint/oxidelake` as a public project with a single-commit history (the private development history is `vyncint/oxidelake-old`). Crates were renamed `oxide-*` → `oxidelake-*` because two of the old names were taken on crates.io, and the GPU kernel sources moved inside `oxidelake-device` so the published crate is self-contained (ADR-0016). Development moved from the Linux CPU box to a macOS machine (Apple M4 Pro, 24 GiB unified memory, Metal 4, Rust 1.98.0), where the whole default gate re-ran green and the Metal backend compiles, lints and **executes**. An AWS `g4dn.xlarge` (NVIDIA Tesla T4) has executed the **CUDA** path in two sessions, 2026-09-06 and 2026-11-18. Three lines of **Phase 8** in [docs/roadmap.md](docs/roadmap.md) stand between this and running in production: double-buffered transfers, TLS for the cluster ports (#30) and a runner for the on-demand CUDA job (#38)._ Legend: `not started` · `in progress` · `done` · `blocked` @@ -18,7 +18,7 @@ Legend: `not started` · `in progress` · `done` · `blocked` ## Verification matrix -Filled in as phases complete. Every component goes under exactly one column — see [docs/verification.md](docs/verification.md). "Executed" now covers three machines: the original Linux CPU box (phases 0–6 gates); since 2026-09-01 a macOS Apple M4 Pro where the same default gate is green and rows marked **(macOS)** actually ran on the Metal device; and since 2026-09-06 an AWS `g4dn.xlarge` (NVIDIA Tesla T4, compute 7.5, driver 595.71, CUDA 13.2, Ubuntu 24.04, Rust 1.98.0) where rows marked **(T4)** actually ran on the CUDA device. The T4 session was the first time any CUDA path executed, and it found a correctness bug in the aggregation kernel (see notes). +Filled in as phases complete. Every component goes under exactly one column — see [docs/verification.md](docs/verification.md). "Executed" now covers three machines: the original Linux CPU box (phases 0–6 gates); since 2026-09-01 a macOS Apple M4 Pro where the same default gate is green and rows marked **(macOS)** actually ran on the Metal device; and since 2026-09-06 an AWS `g4dn.xlarge` (NVIDIA Tesla T4, compute 7.5, driver 595.71, CUDA 13.2, Ubuntu 24.04, Rust 1.98.0) where rows marked **(T4)** actually ran on the CUDA device. The T4 session was the first time any CUDA path executed, and it found a correctness bug in the aggregation kernel (see notes). A second T4 session (2026-11-18, same instance type, driver 595.71.05, CUDA 13.2) ran every CUDA path 0.3.0 changes. It ran on the fix branches before they merged (#139–#154), not on the tagged commit; those results are marked **(T4, 2026-11-18)**. | Component | Executed (Linux CPU box · macOS M4 Pro · T4) | Compiled only | Needs GPU to execute | |---|---|---|---| @@ -30,11 +30,11 @@ Filled in as phases complete. Every component goes under exactly one column — | `CudaBackend` (dynamic loading, NVRTC pipeline, transfers, upload/download) | driver probe + typed error on GPU-less box; **(T4)** `cargo test -p oxidelake-device --features cuda -- --include-ignored` — transfers, pinned memory round trip, NVRTC compile + launch all executed | | | | `CudaPinnedProvider` / `PinnedBuf` | **(T4)** pinned allocation and H2D/D2H through it (`transfers_and_pinned_memory_round_trip_on_device`) | | | | `MetalBackend`, `MetalSharedBuffer`, Metal kernel dispatch (filter+project, vector distance) | **(macOS)** conformance suite on the real device: `cargo test -p oxidelake-compute --features metal -- --ignored` — `HardwareDetector` selects Metal, MSL compiles via `newLibraryWithSource`, Int64 filter + vector distance dispatch on the GPU and equal stock DataFusion, **and the test asserts device execution through the operator's transfer counters (`bytes_h2d`/`bytes_d2h` > 0), so equal results cannot be mistaken for a silent CPU fallback**; join/aggregate are declared unsupported up front and take the CPU path without uploading; `oxidelake-device`/`oxidelake-memory`/`oxidelake-runtime` metal suites green. Correction (2026-09-02): until the operator layer learned to keep `Utf8` columns on the host, the suite's fixtures (which all carry a `Utf8` column) made every operator fall back to the CPU on Metal, so the earlier version of this row over-claimed — real Metal dispatch had only been exercised by the Int64-only queries in `oxidelake-runtime/tests/embedded.rs` | | | -| CUDA kernel sources (`crates/oxidelake-device/kernels/cuda/*.cu`) + launch orchestration (`cuda/ops.rs`) | embedded-source and scan-helper unit tests; **(T4)** every kernel NVRTC-compiled and launched (the hash join and `aggregation.cu` as they were in 0.2.0: see the next two rows): conformance suite `OXIDE_BACKEND=cuda cargo test -p oxidelake-compute --features cuda -- --ignored` equal to stock DataFusion (3 seeds × 5 sizes × filter/join/aggregate/vector L2+cosine) **with the transfer-counter witness (`bytes_h2d`/`bytes_d2h` > 0)**; the aggregation kernel's group-table publication bug (below) fixed and re-verified | | `filter_project.cu`'s `Float64` comparison as changed for #28 (DataFusion's order: NaN above `+inf`, `-0.0` = `+0.0`): not NVRTC-compiled or run anywhere yet — `gpu_backend_filters_special_floats_like_datafusion_when_available` (`--ignored`) is for the next T4 run | -| `hash_join.cu` as rewritten for 0.3.0 (`oxide_hj_count`, `oxide_hj_expand` over a distinct-key index the host builds) and its launch orchestration (#45, #95, #108) | the host index (`join_slots`: placement, a replica of the device probe loop, the slot reads per probe row for #108's four build shapes) unit-tested in `oxidelake-device`; the operator's device path (prepare once, probe, gather in pieces, finish on the CPU from the same match) through a fake backend in `oxidelake-compute`. The kernel source itself only under **g++ with a shim of the CUDA builtins, thread by thread, against a nested-loop join** (2026-11-17, ASan + UBSan, a harness outside the repository; both kernels only read shared state, so a sequential run computes what the device does) — **not NVRTC, not a GPU** | `cuda/ops.rs` join section: `make check-cuda lint-cuda` | NVRTC compile + launch on the T4: `OXIDE_BACKEND=cuda cargo test -p oxidelake-compute --features cuda -- --ignored` (conformance join, including the chunked one) and `--test join_timing -- --ignored --nocapture` (timings; the file also runs unchanged on 08a9147 for the before) | -| `aggregation.cu` as changed for 0.3.0 (`oxide_agg_number_groups`, accumulators and read-back of one entry per group) and its launch orchestration (#45, the aggregate half) | the host half (`finish_groups`: groups numbered in any order come back sorted by key, `NULL` group last) unit-tested under `--features cuda`; a device result merged per batch through a fake backend in `oxidelake-compute` (#29). The kernel source itself only under **g++ with a shim of the CUDA builtins, thread by thread, against a host reference** (2026-11-18, ASan + UBSan, a harness outside the repository: no rows, only `NULL` keys, one key, a group per row, extreme keys, 100 keys in 65 536 rows; a sequential run cannot exercise the slot-claim race, whose protocol did not change), and compiled to PTX for sm_75 by clang 21 against stubbed SDK atomics — **not NVRTC, not a GPU** | `cuda/ops.rs` aggregate section: `make check-cuda lint-cuda`, `cargo clippy -p oxidelake-device --features cuda --all-targets` | NVRTC compile + launch on the T4: `cargo test -p oxidelake-device --features cuda -- --ignored` (`aggregate_numbers_groups_like_the_reference` and the three older aggregate tests), `OXIDE_BACKEND=cuda cargo test -p oxidelake-compute --features cuda --test conformance -- --ignored` (the aggregate checks, now also in 7-row batches) and `--test aggregate_timing -- --ignored --nocapture` (timings of a 10M-row `GROUP BY` with 100 keys; the file also runs unchanged on 08a9147 for the before) | +| CUDA kernel sources (`crates/oxidelake-device/kernels/cuda/*.cu`) + launch orchestration (`cuda/ops.rs`) | embedded-source and scan-helper unit tests; **(T4)** every kernel NVRTC-compiled and launched (the hash join and `aggregation.cu` as they were in 0.2.0: see the next two rows): conformance suite `OXIDE_BACKEND=cuda cargo test -p oxidelake-compute --features cuda -- --ignored` equal to stock DataFusion (3 seeds × 5 sizes × filter/join/aggregate/vector L2+cosine) **with the transfer-counter witness (`bytes_h2d`/`bytes_d2h` > 0)**; the aggregation kernel's group-table publication bug (below) fixed and re-verified; **(T4, 2026-11-18)** every kernel module compiled for the device's own architecture (`kernels_compile_for_the_devices_own_architecture`, `every_kernel_module_compiles_for_the_device_architecture`, #107), wrapped `SUM(Int64)` (`aggregate_wraps_int64_sums_like_the_reference`, #46), and `filter_project.cu`'s `Float64` comparison as changed for #28 (DataFusion's order: NaN above `+inf`, `-0.0` = `+0.0`) through `gpu_backend_filters_special_floats_like_datafusion_when_available` | | | +| `hash_join.cu` as rewritten for 0.3.0 (`oxide_hj_count`, `oxide_hj_expand` over a distinct-key index the host builds) and its launch orchestration (#45, #95, #108) | the host index (`join_slots`: placement, a replica of the device probe loop, the slot reads per probe row for #108's four build shapes) unit-tested in `oxidelake-device`; the operator's device path (prepare once, probe, gather in pieces, finish on the CPU from the same match) through a fake backend in `oxidelake-compute`. The kernel source itself only under **g++ with a shim of the CUDA builtins, thread by thread, against a nested-loop join** (2026-11-17, ASan + UBSan, a harness outside the repository; both kernels only read shared state, so a sequential run computes what the device does). **(T4, 2026-11-18)** NVRTC-compiled and launched: the conformance joins, the chunked one included, equal stock DataFusion under `OXIDE_BACKEND=cuda cargo test -p oxidelake-compute --features cuda -- --include-ignored`. `--test join_timing -- --ignored --nocapture` gave these debug-build times, CPU reference vs device: 104.6 vs 91.8 ms for 65 536 probes against 100 000 unique build keys; 40.0 vs 33.3 ms with every build row on one key and no probe hitting it; 67.9 vs 68.0 ms for 1.6M output rows; and 1.8 vs 50.9 ms at the conformance size, where launch overhead dominates | | | +| `aggregation.cu` as changed for 0.3.0 (`oxide_agg_number_groups`, accumulators and read-back of one entry per group) and its launch orchestration (#45, the aggregate half) | the host half (`finish_groups`: groups numbered in any order come back sorted by key, `NULL` group last) unit-tested under `--features cuda`; a device result merged per batch through a fake backend in `oxidelake-compute` (#29). The kernel source itself only under **g++ with a shim of the CUDA builtins, thread by thread, against a host reference** (2026-11-18, ASan + UBSan, a harness outside the repository: no rows, only `NULL` keys, one key, a group per row, extreme keys, 100 keys in 65 536 rows; a sequential run cannot exercise the slot-claim race, whose protocol did not change), and compiled to PTX for sm_75 by clang 21 against stubbed SDK atomics. **(T4, 2026-11-18)** NVRTC-compiled and launched: `aggregate_numbers_groups_like_the_reference` and the three older aggregate device tests, and the conformance aggregate checks (also in 7-row batches) under `OXIDE_BACKEND=cuda`. `--test aggregate_timing -- --ignored --nocapture` (debug build) ran 10M rows with 100 keys and `NULL` in 153 device calls: best of 3, 189.5 ms against 4514.8 ms for the CPU reference | | | | Metal kernel sources (`crates/oxidelake-device/kernels/metal/*.metal`) | **(macOS)** MSL runtime compile + dispatch, exercised by the conformance suite above | | | -| `Gpu*Exec` operators (filter+project, hash join, aggregate, vector distance) on `CpuBackend` | conformance suite vs stock DataFusion; EXPLAIN tags; per-batch CPU fallback path; the device transfer format without a device (`TransferSim`, a CUDA-claiming backend whose uploads and downloads go through `columns`): vector columns with NULL elements through filter, join and vector distance, with the transfer counters as witness of which path ran (#105); `Float64` filters over NaN (both signs), ±0.0, ±inf and subnormals, against stock DataFusion and against its order written out by hand (#28); **(macOS)** same suite executed on `MetalBackend`; **(T4)** same suite executed on `CudaBackend` | | the same #105 checks on a device (`gpu_backend_keeps_null_vector_elements_when_available`, `--ignored`): not run on Metal or the T4 yet; nor the #28 special-float filters (`gpu_backend_filters_special_floats_like_datafusion_when_available`, `--ignored`) | +| `Gpu*Exec` operators (filter+project, hash join, aggregate, vector distance) on `CpuBackend` | conformance suite vs stock DataFusion; EXPLAIN tags; per-batch CPU fallback path; the device transfer format without a device (`TransferSim`, a CUDA-claiming backend whose uploads and downloads go through `columns`): vector columns with NULL elements through filter, join and vector distance, with the transfer counters as witness of which path ran (#105); `Float64` filters over NaN (both signs), ±0.0, ±inf and subnormals, against stock DataFusion and against its order written out by hand (#28); **(macOS)** same suite executed on `MetalBackend`; **(T4)** same suite executed on `CudaBackend`. The #105 and #28 device checks (`gpu_backend_keeps_null_vector_elements_when_available`, `gpu_backend_filters_special_floats_like_datafusion_when_available`) pass on `MetalBackend` in the macOS CI job; Metal runs `Float64` predicates on the CPU path, so for #28 that checks the fallback. They also pass **(T4, 2026-11-18)** on `CudaBackend` | | | | `GpuOperator` fallback + telemetry, `local_backend()` selection | unit + conformance tests (CPU); **(T4)** CUDA streams and transfer accounting through the conformance witness; a 1M-row `oxide sql … --target cuda` with `RUST_LOG=oxidelake_compute=debug` logged **no** per-batch CPU fallback (since 0.2.0 the same claim is a counter, `fallback_batches`, in the Inspector panel and in every `OperatorSnapshot`, rather than something only a raised log level can see — #32) | | | | Parquet writer options + `write_parquet` (row groups, dictionaries, Bloom filters on keys, page statistics) | unit test inspects row-group/Bloom metadata; a refused, failed or abandoned write leaves the file it would replace untouched (`parquet_io`/`datagen` unit tests, `oxide gen-data --row-group-rows 0` in `tests/cli.rs`, #119) | | | | DataFusion pruning settings + `scan_pruning_metrics` proof (statistics, Bloom filter, page index) | `tests/pruning.rs` on a 200k-row / 100-row-group dataset | | | @@ -56,6 +56,24 @@ Filled in as phases complete. Every component goes under exactly one column — | `OxideFrame` DataFrame API (filter/select/join/aggregate/vector_distance/explain/collect/show) | `oxidelake-api/tests/dataframe.rs` vs SQL equivalents; `show` run in a child process, whole and into a closed pipe (`tests/show_closed_pipe.rs`, #125) | | | | `oxide tui` (query dashboard: plan DAG + live telemetry + column profiles) | dashboard unit test (plan tags, real counters, profiles); driven end to end in a sized PTY (demo + `--query --target metal`), `q` exits 0 | | | +## Known limitations + +These are open defects in 0.3.0 that live in the upstream DataFusion and Ballista chain rather than in OxideLake's code. Each has a workaround, and an issue that closes when the chain carries the fix. + +- **A Float64 filter over Parquet can drop NaN rows, on every target** ([#142](https://github.com/vyncint/oxidelake/issues/142); upstream [apache/datafusion#15812](https://github.com/apache/datafusion/issues/15812)). + - Cause: Parquet's row-group statistics leave NaN out of a float column's min and max. A row group holding `[NaN, 1.0]` records a max of 1.0, so `v > 2.0` prunes the whole group, the NaN row with it. + - Why it is wrong: DataFusion orders NaN above every number, so that NaN row belongs in the result. + - `--target cpu` is affected too: the bug is in the DataFusion 55 scan that every target uses. + - **Workaround:** `SET datafusion.execution.parquet.pruning = false` for such a query or session. The NaN rows come back, at the cost of reading every row group. +- **A cluster query that loses a worker fails rather than recovering** ([#148](https://github.com/vyncint/oxidelake/issues/148); upstream fix [apache/datafusion-ballista#2677](https://github.com/apache/datafusion-ballista/pull/2677), merged after 55.0.0 and not yet released). + - Cause: Ballista 55 recovers from a lost worker by rolling back the stages that read the worker's shuffle output. That rollback can emit some hash partitions twice, with exit 0. It can also leak the surviving workers' task slots, so the query waits for a new worker. + - What 0.3.0 does: `--stage-max-failures` defaults to 1. A query that held finished output on a worker that stops, is killed or goes silent fails at once, naming the worker. **Workaround:** run the query again. + - The error does not name the worker when it was killed while sending a shuffle block. Ballista then reports a broken stream, which fails the query just as cleanly. + - A worker lost before any of its tasks finished costs nothing: Ballista runs those tasks again elsewhere, and the query completes with the right rows. + - Raising `--stage-max-failures` turns the rollback, and the bug, back on. + - A worker that receives `SIGTERM` in its first ~30 ms, before Ballista's executor listens, exits 0 only when `--drain-timeout` passes. + - The in-process `start_standalone` cluster keeps Ballista's defaults, since its workers live and die with the process. + ## Resolved dependency set Resolved 2026-11-11 for the Ballista 55 bump (`cargo tree`, 593 crates in `Cargo.lock`, no duplicate majors): ballista / ballista-core / ballista-scheduler / ballista-executor **55.0.0** · datafusion **55.2.0** · datafusion-proto **55.2.0** · arrow **59.3.2** · parquet **59.3.2** (no `thrift`) · arrow-flight **59.3.2** (transitive) · object_store **0.13.2** · tonic **0.14.6** · prost **0.14.4** · tokio **1.54.1** · ratatui **0.30.2** · crossterm **0.29.0**. The 54 set it replaced was resolved 2026-08-29 (573 crates: Ballista 54.1.0, DataFusion 54.1.0, arrow/parquet 58.4.0). Evidence and rules: [docs/dependencies.md](docs/dependencies.md). @@ -64,13 +82,10 @@ Resolved 2026-11-11 for the Ballista 55 bump (`cargo tree`, 593 crates in `Cargo - Operator parameter types (`Predicate`, `AggregateSpec`, …) live in `oxidelake_core::params`, not `oxidelake-compute`: the device crate's operator arguments need them and `oxidelake-compute` depends on `oxidelake-device`. `oxidelake-compute` re-exports them. - The spill manager's device tier is abstracted behind `oxidelake_memory::DeviceResident` (bytes + copy-to-host), so `oxidelake-memory` never depends on a backend; the Arrow IPC spill codec lives in `oxidelake_memory::ipc` (storage reuses it) to keep the dependency direction. -- Spill accounting uses each batch's logical host size recorded at first host residency: batches decoded from IPC over-report `get_array_memory_size` because every column counts the shared message buffer. +- Spill accounting charges a batch the bytes of its own slice of its columns' buffers (`SpillManager::batch_bytes`, #116), recorded at first host residency and reused on promotion, so a batch back from disk is charged what it was charged before. Until 0.3.0 it was `get_array_memory_size`, which charged a slice its parent's whole buffers and an IPC-decoded batch the shared message buffer once per column. - cudarc panics if a driver symbol is requested while `libcuda` is absent, and an NVRTC symbol while `libnvrtc` is; the CUDA backend probes `cudarc::driver::sys::is_culib_present()` before any driver call and `cudarc::nvrtc::sys::is_culib_present()` before CUDA counts as available, so a GPU-less machine gets `EngineError::Device`, never a panic. The NVRTC probe came later (#106): NVRTC ships with the CUDA toolkit, not the driver, and a driver-only host used to select CUDA and panic on its first kernel compile. - NVRTC compiles every module for the device's own architecture (`--gpu-architecture=compute_XY` from its compute capability, or the newest older target the NVRTC supports, since PTX for an older target still runs) and a device below compute capability 7.0 is refused (#107). Without a target NVRTC used its own default: `compute_52` for CUDA 12.x — the version the crate is built against — where `aggregation.cu`'s `atomicAdd(double*)` does not compile, and which is below the `compute_70` its slot-claim spin-wait needs to run under independent thread scheduling. The T4 never saw it: its CUDA 13.2 NVRTC defaults to `compute_75`. Compiled and unit-tested only (target choice, refusals); `every_kernel_module_compiles_for_the_device_architecture` is for the next T4 run, once with a 12.x NVRTC first on `LD_LIBRARY_PATH`. -- Spill accounting charges a batch the bytes of its own slice of its columns' buffers (`SpillManager::batch_bytes`, #116), recorded at first host residency and reused on promotion, so a batch back from disk is charged what it was charged before. Until 0.3.0 it was `get_array_memory_size`, which charged a slice its parent's whole buffers and an IPC-decoded batch the shared message buffer once per column. -- cudarc panics if a driver symbol is requested while `libcuda` is absent; the CUDA backend probes `cudarc::driver::sys::is_culib_present()` before any driver call, so a GPU-less machine gets `EngineError::Device`, never a panic. - - `Gpu*Exec` nodes carry the *planned* backend as their `EXPLAIN` tag but select the *real* backend at `execute()` from `local_backend()` (hardware detector, cached per process); any `Unsupported` from a GPU path falls back to the CPU reference for that batch. - Device-side prefix scans (block counts, per-row join match counts) round-trip through the host in v1; the aggregate's group table is finalized on the host (sorted, `NULL` group last) so results match the CPU reference exactly. `SUM(Int64)` wraps on overflow on every backend, as stock DataFusion's does (`add_wrapping` in every `SUM` accumulator): until 0.3.0 the CPU reference errored instead, so a GPU target failed a query the CPU target answered, and the CUDA kernel's wrap — recorded here as a divergence — was the behaviour that matched DataFusion (#100, #46). - `GpuAggregateExec` aggregates each input partition on its own and declares the partitioning of the `AggregateExec` it replaces (#90; until 0.3.0 it concatenated every input partition into one output partition, which broke operators planned on the original's N hash partitions). It streams (#29): each input batch goes to the backend on its own, and the batch's groups are folded into one accumulator per group on the host (`kernels::GroupedAggregator`, which the CPU reference is now built on), so a partition holds its groups rather than its input and a device's row limits apply to one batch. Until 0.3.0 it collected each partition's whole input first. Measured with `/usr/bin/time -v` on 2026-11-18 (Linux, 20 cores, no GPU, so the operator runs the CPU reference), `oxide sql --target cuda` over `gen-data` tables, `SELECT k, SUM(v), COUNT(v), MIN(v), MAX(id) … GROUP BY k` (100 keys and `NULL`): peak RSS 229, 578 and 1,039 MiB for 2.5, 10 and 20 million rows before, 150, 153 and 158 MiB after, against 120 to 138 MiB for stock DataFusion (`--target cpu`), with identical results; at 20 million rows it now follows the batch size instead (137 MiB at `--batch-size 8192`, 158 MiB at 65,536). `GpuHashJoinExec` collects the whole build side **once** and shares it across probe partitions (a lazily started `Shared` future, reset by `with_new_children`/`reset_state`), a v1 simplification recorded for Phase 5 planning. From e1325c112fee7c13eae5f141067885499bf26843 Mon Sep 17 00:00:00 2001 From: Vyncint Ng <115854244+vyncint@users.noreply.github.com> Date: Wed, 18 Nov 2026 17:46:16 +0700 Subject: [PATCH 5/6] release: v0.3.0 CHANGELOG: [Unreleased] becomes [0.3.0] - 2026-11-18, with an introduction (what the release is, how its CUDA paths were verified, the two known upstream issues) and the link definitions repointed. Its sections are consolidated to one heading each. The fix PRs each added a '### Fixed' heading of their own, so main had seven, and seven bullets had landed under Fixed that their fix branches filed under Changed: two marked Breaking (TelemetrySnapshot.operator_totals, #102) and API or default changes (BufferLayout::padded_len, #90, #46, the CUDA aggregate's read-back, #134, #148). They are under Changed now, as the preamble promises for every breaking change. No line of text was added, lost or duplicated by the move (checked). Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com> --- CHANGELOG.md | 222 +++++++++++++++++++++++++++++---------------------- 1 file changed, 128 insertions(+), 94 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dcf10fd..85471db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,33 @@ versions (0.x) may contain breaking changes; they are always listed under a ## [Unreleased] +## [0.3.0] - 2026-11-18 + +The correctness release. + +- The dependency chain moves to Ballista 55, DataFusion 55.2 and arrow 59. That move is breaking; see Changed. +- A review of the whole engine found 47 defects (#86–#132), and fixing them turned up two more (#133, #134). All 49 are fixed here. They include: + - places where GPU placement could change a query's result: a LIMIT, `COUNT(*)`, an ORDER BY over a merge join or an aggregate, a `UNION ALL` of aggregates, NaN and `-0.0` in a `Float64` filter, and NULL elements in a vector column; + - malformed Parquet, Arrow IPC and model files that could panic or exhaust memory; + - the Ballista 55 move itself, which left a cluster running no GPU operator at all. That one was never released. +- A cluster now fails a query that loses a worker rather than risk Ballista 55's rollback, which can return rows twice (#148). + +**CUDA verification.** No `gpu` runner is registered yet (#38), so no device has run the tagged commit. Every CUDA change in this release ran on a Tesla T4 (driver 595.71.05, CUDA 13.2) on 2026-11-18, on the fix branches before they merged: + +- the rebuilt hash join, and the aggregate sized by its groups (#45, #95, #108); +- the streaming aggregate (#29); +- wrapped `SUM(Int64)` (#46); +- the float comparison (#28); +- NULL vector elements (#105); +- kernels compiled for the device's own architecture (#107). + +[STATUS.md](https://github.com/vyncint/oxidelake/blob/main/STATUS.md) lists the suites and timings. + +**Known issues.** Both are upstream, and both have a workaround: + +- A `Float64` filter over Parquet can drop NaN rows on every target (#142, apache/datafusion#15812). Run `SET datafusion.execution.parquet.pruning = false` for such a query. +- A lost cluster worker fails its query (#148, above). Run the query again. + ### Added - **Graceful shutdown, Ballista's retry limits, and what losing a worker @@ -30,6 +57,7 @@ versions (0.x) may contain breaking changes; they are always listed under a that exec instance has reported to its telemetry hub (`None` before it first executes, or without a hub). It is how a reader pairs a plan node with its own counters: the hub's entries carry only a name (#123). + - **`gpu.yml`: the CUDA suites on a real device, on demand** (#38). A `workflow_dispatch` workflow for a self-hosted runner labelled `gpu` runs the new `make test-cuda-device` (the device tests with the ignored ones, @@ -45,6 +73,7 @@ versions (0.x) may contain breaking changes; they are always listed under a vectors.** `OxideFrame::vector_distance` propagates this planning error instead of passing a zero-dimension fixed-size list to DataFusion and panicking. + - **Breaking: the dependency chain moves to Ballista 55, DataFusion 55 and arrow / parquet 59** (#40). DataFusion is this project's public vocabulary (ADR-0009: `OxideFrame::new`, `into_inner`, @@ -54,23 +83,27 @@ versions (0.x) may contain breaking changes; they are always listed under a changed. `object_store` stays on 0.13 and the minimum Rust stays 1.94.1. Resolved: ballista 55.0.0, datafusion and datafusion-proto 55.2.0, arrow, parquet and arrow-flight 59.3.2. + - `OxidePhysicalCodec` follows DataFusion 55's `PhysicalExtensionCodec`, whose `try_decode` and `try_encode` now take a `PhysicalProtoConverterExtension`; the codec hands it on to Ballista's. A caller that invokes the codec directly passes one, usually `datafusion_proto::physical_plan::DefaultPhysicalProtoConverter {}`. + - **Cluster workers run with a bounded memory pool** (Ballista 55). An executor now installs a `FairSpillPool` of 70% of the host's or cgroup's detected memory, split across its concurrent tasks, where Ballista 54 left DataFusion's pool unbounded: a DataFusion operator on a worker that used to grow without limit now spills, or fails with a resources-exhausted error. The `Gpu*Exec` operators do not reserve from it. + - `GpuOperator::hash_join` takes the batch size and returns a `JoinProbe`, whose output `GpuOperator::next_join_chunk` hands out one batch of at most that size at a time, in place of one `RecordBatch` holding every match (#95). *Migration:* `let mut probe = op.hash_join(&left, &build, key, projection, batch_size)?;` then `while let Some(batch) = op.next_join_chunk(&mut probe, &build)? { … }`. + - **`GpuBackend` prepares a hash join's build side once and probes it in two steps** (the join half of #45). The CUDA backend used to rebuild its join table for every probe batch; `prepare_join_build` now indexes the @@ -87,6 +120,7 @@ versions (0.x) may contain breaking changes; they are always listed under a path, counted in `fallback_batches`, and it is handed the build side once rather than once per probe batch. Compiled, not yet run on a GPU: STATUS.md has the T4 commands. The aggregate half of #45 is still open. + - **The CUDA hash join keeps one slot per distinct build key** (#108). A key repeated D times on the build side took D slots, so building the table cost O(D²) `atomicCAS` attempts per probe batch and a probe row @@ -113,6 +147,85 @@ versions (0.x) may contain breaking changes; they are always listed under a `float()` and JavaScript's `Number()` read back. `--help` and the README say so. +- `BufferLayout::padded_len` returns `Option`: `None` when rounding + the length up to the alignment overflows (#104). Where a `usize` was used, + handle the `None`; a layout built through `BufferLayout::new` always has + `Some`, since `new` now refuses those lengths up front. + +- **CUDA's `SUM(Int64)` wrap is no longer called a divergence** (#46). It is + what stock DataFusion does, so `cuda/ops.rs` no longer documents it as a + divergence by design and the roadmap line no longer asks for an overflow + error: #46 was filed on the premise that DataFusion raises one, and it + wraps. The CPU reference was the outlier and now wraps too (#100, under + Fixed). The `#[ignore]`d device test + `aggregate_wraps_int64_sums_like_the_reference` and the conformance + suite's GPU pass pin the kernel to the reference's wrapped answer when + they next run on a CUDA machine. + +- **`GpuAggregateExec` aggregates each input partition on its own** (#90). + `GpuAggregateExec::try_new` still builds a complete aggregate of any + input, but merges a multi-partition input with a `CoalescePartitionsExec` + that `input()` now returns, where it used to read every partition inside + `execute(0)`; the new `GpuAggregateExec::try_new_partitioned` aggregates + per partition and declares its input's partitioning, which is what the + placement rule and the plan codec build, and what `with_new_children` + keeps. Code that builds the exec with `try_new` gets the same rows; + code that walked from it to its input sees the merge node first. + **`EXPLAIN` shows two `GpuAggregateExec` nodes for a two-phase + aggregate**, the final half over DataFusion's `RepartitionExec` or + `CoalescePartitionsExec` over the partial half; the final half merges + partial results, so a `COUNT` reads there as `SUM(count(t.v)[count])`. + +- **The CUDA aggregate reads back its groups, not its group table** (the + aggregate half of #45). Every call allocated accumulators of two slots + per input row and copied all of them back with the table's keys and + states, so a batch's device-to-host traffic followed its rows whatever + the number of groups: 16.3 MB for a 65 536-row batch with 101 groups + and eight aggregates (the 0.2.0 kernel and host flow, run on the CPU + under a shim of the CUDA builtins). A second launch now numbers the + groups densely on the device, the accumulators hold one entry per group, + and only the groups are read back: 12 KB for the same batch. The index + of keys stays two slots per row, on the device, and since #29 a call is + one batch. Results are unchanged. Compiled, not yet run on a GPU: + STATUS.md has the T4 commands, and `tests/aggregate_timing.rs` times a + 10-million-row `GROUP BY` before and after. + +- **Breaking: `TelemetrySnapshot` gained a public field, `operator_totals`** + (#102): the lifetime totals per operator name and backend, as the new + `oxidelake_core::telemetry::OperatorTotals`, which is what + `to_prometheus` exports now. A struct literal over `TelemetrySnapshot` no + longer compiles; add `operator_totals: Vec::new()`, as the TUI's demo + model does. + +- **Cluster queries keep Ballista's static planner** (#134). Ballista 55 + plans adaptively by default, and its adaptive planner swaps the session's + physical optimizer rules for Ballista's own, so on the 55 chain a + GPU-targeted cluster ran no `Gpu*Exec` operator at all while `EXPLAIN` + still showed them (never released: 0.2.0 is on Ballista 54, which plans + statically). `ballista.planner.adaptive.enabled` is now `false` in every + OxideLake cluster session, and the scheduler overrides a client that sets + it to `true`, with a warning in its log. Adaptive join selection and + partition coalescing are therefore not available on an OxideLake cluster + until the placement rule can run inside the adaptive planner. + +- **A cluster no longer retries a query that loses a worker** (#148). + Ballista 55 recovers such a query by rolling back the stages that read the + lost worker's output and running them again, and in 55.0.0 that recovery + is not safe: a self-join that lost a worker mid-flight came back with 13 + or 14 of its 100 groups twice, exit 0, in 12 runs of 15 (fixed upstream by + apache/datafusion-ballista#2677, unreleased), and a worker stopped with + `SIGTERM` mid-query left it hanging (apache/datafusion-ballista#2539, + #2698). `oxide-scheduler` now fails a query that held output on a worker + it loses, whether killed, stopped or silent past `--worker-timeout`, with + an error naming the worker (one killed in the middle of a transfer shows + as a broken shuffle stream instead), and `--stage-max-failures` defaults + to 1, so + a failed fetch from a lost worker ends the query too; a query whose tasks + on that worker had not finished anything still runs them again elsewhere. + **Migration:** a query that used to survive losing a worker now fails; + run it again. To get Ballista's stage retries back, pass + `--stage-max-failures 4`, which brings the bug back with them. + ### Fixed - **A LIMIT over a GPU-placed filter or join returns its row count again** @@ -186,6 +299,7 @@ versions (0.x) may contain breaking changes; they are always listed under a (`oxide_operator_bytes_h2d_total`, `oxide_operator_bytes_d2h_total`, `oxide_operator_rows_in_total`) and `OperatorSnapshot` change with them; a dashboard that charts those series will show a step at the upgrade. + - **A join whose key repeats on both sides no longer aborts the process** (#95). `GpuHashJoinExec` gathered every match of a probe batch into one output batch, so a key repeated on both sides arrived as the product of @@ -202,13 +316,6 @@ versions (0.x) may contain breaking changes; they are always listed under a `hash_join_gather`, the reference for gathering a range of a probe's matches. -- `BufferLayout::padded_len` returns `Option`: `None` when rounding - the length up to the alignment overflows (#104). Where a `usize` was used, - handle the `None`; a layout built through `BufferLayout::new` always has - `Some`, since `new` now refuses those lengths up front. - -### Fixed - - **A machine with the NVIDIA driver but no NVRTC runs on the CPU instead of panicking** (#106). Detection probed only `libcuda`, so a driver-only host — or a container that has `libcuda` injected by the NVIDIA container @@ -238,46 +345,6 @@ versions (0.x) may contain breaking changes; they are always listed under a selects the CPU and logs why, and `OXIDE_BACKEND=cuda` fails at startup saying which. New: `CudaBackend::nvrtc_arch`. -- **CUDA's `SUM(Int64)` wrap is no longer called a divergence** (#46). It is - what stock DataFusion does, so `cuda/ops.rs` no longer documents it as a - divergence by design and the roadmap line no longer asks for an overflow - error: #46 was filed on the premise that DataFusion raises one, and it - wraps. The CPU reference was the outlier and now wraps too (#100, under - Fixed). The `#[ignore]`d device test - `aggregate_wraps_int64_sums_like_the_reference` and the conformance - suite's GPU pass pin the kernel to the reference's wrapped answer when - they next run on a CUDA machine. - -- **`GpuAggregateExec` aggregates each input partition on its own** (#90). - `GpuAggregateExec::try_new` still builds a complete aggregate of any - input, but merges a multi-partition input with a `CoalescePartitionsExec` - that `input()` now returns, where it used to read every partition inside - `execute(0)`; the new `GpuAggregateExec::try_new_partitioned` aggregates - per partition and declares its input's partitioning, which is what the - placement rule and the plan codec build, and what `with_new_children` - keeps. Code that builds the exec with `try_new` gets the same rows; - code that walked from it to its input sees the merge node first. - **`EXPLAIN` shows two `GpuAggregateExec` nodes for a two-phase - aggregate**, the final half over DataFusion's `RepartitionExec` or - `CoalescePartitionsExec` over the partial half; the final half merges - partial results, so a `COUNT` reads there as `SUM(count(t.v)[count])`. - -- **The CUDA aggregate reads back its groups, not its group table** (the - aggregate half of #45). Every call allocated accumulators of two slots - per input row and copied all of them back with the table's keys and - states, so a batch's device-to-host traffic followed its rows whatever - the number of groups: 16.3 MB for a 65 536-row batch with 101 groups - and eight aggregates (the 0.2.0 kernel and host flow, run on the CPU - under a shim of the CUDA builtins). A second launch now numbers the - groups densely on the device, the accumulators hold one entry per group, - and only the groups are read back: 12 KB for the same batch. The index - of keys stays two slots per row, on the device, and since #29 a call is - one batch. Results are unchanged. Compiled, not yet run on a GPU: - STATUS.md has the T4 commands, and `tests/aggregate_timing.rs` times a - 10-million-row `GROUP BY` before and after. - -### Fixed - - **`SUM(Int64)` wraps on overflow under a GPU target, as it does in stock DataFusion** (#100). The CPU reference — what every operator placed on a device falls back to, and what every GPU kernel is checked against — @@ -333,15 +400,6 @@ versions (0.x) may contain breaking changes; they are always listed under a DataFusion's exchange between them, and each `GpuAggregateExec` declares the partitioning of the node it replaces. -- **Breaking: `TelemetrySnapshot` gained a public field, `operator_totals`** - (#102): the lifetime totals per operator name and backend, as the new - `oxidelake_core::telemetry::OperatorTotals`, which is what - `to_prometheus` exports now. A struct literal over `TelemetrySnapshot` no - longer compiles; add `operator_totals: Vec::new()`, as the TUI's demo - model does. - -### Fixed - - **`predict` scores a feature vector with a NULL element as NULL** (#97). Only the vector's own validity was checked, so a NULL element was read from the values buffer as whatever lay there, 0.0 from every Arrow @@ -368,8 +426,6 @@ versions (0.x) may contain breaking changes; they are always listed under a the second run of a query logged twice the first's numbers; it now counts that query's operators only. -### Fixed - - **A corrupt page found mid-scan is `EngineError::Format`, as documented.** `classify_error` now looks inside the `Shared`, `Diagnostic` and `Collection` wrappers DataFusion puts around a scan's @@ -378,8 +434,6 @@ versions (0.x) may contain breaking changes; they are always listed under a `Format`; code that matched on `EngineError::DataFusion` for such errors now gets `Format` or `Io` (#118). -### Fixed - - **A refused `oxide gen-data` no longer empties the table it would have replaced** (#119). `--row-group-rows 0` truncated the existing `t.parquet` to zero bytes before refusing the flag. The options are now @@ -461,36 +515,6 @@ versions (0.x) may contain breaking changes; they are always listed under a the deletes run on a thread and runtime of their own and the drop waits for them; after 30 seconds it stops waiting and lets them finish in the background. A file that cannot be deleted is logged at `warn`. -- **Cluster queries keep Ballista's static planner** (#134). Ballista 55 - plans adaptively by default, and its adaptive planner swaps the session's - physical optimizer rules for Ballista's own, so on the 55 chain a - GPU-targeted cluster ran no `Gpu*Exec` operator at all while `EXPLAIN` - still showed them (never released: 0.2.0 is on Ballista 54, which plans - statically). `ballista.planner.adaptive.enabled` is now `false` in every - OxideLake cluster session, and the scheduler overrides a client that sets - it to `true`, with a warning in its log. Adaptive join selection and - partition coalescing are therefore not available on an OxideLake cluster - until the placement rule can run inside the adaptive planner. - -- **A cluster no longer retries a query that loses a worker** (#148). - Ballista 55 recovers such a query by rolling back the stages that read the - lost worker's output and running them again, and in 55.0.0 that recovery - is not safe: a self-join that lost a worker mid-flight came back with 13 - or 14 of its 100 groups twice, exit 0, in 12 runs of 15 (fixed upstream by - apache/datafusion-ballista#2677, unreleased), and a worker stopped with - `SIGTERM` mid-query left it hanging (apache/datafusion-ballista#2539, - #2698). `oxide-scheduler` now fails a query that held output on a worker - it loses, whether killed, stopped or silent past `--worker-timeout`, with - an error naming the worker (one killed in the middle of a transfer shows - as a broken shuffle stream instead), and `--stage-max-failures` defaults - to 1, so - a failed fetch from a lost worker ends the query too; a query whose tasks - on that worker had not finished anything still runs them again elsewhere. - **Migration:** a query that used to survive losing a worker now fails; - run it again. To get Ballista's stage retries back, pass - `--stage-max-failures 4`, which brings the bug back with them. - -### Fixed - **Cluster mode returns the right rows for `NOT IN (subquery)`** (#91). Under Ballista 54 a cluster session (`prefer_hash_join = false`) had @@ -532,6 +556,7 @@ versions (0.x) may contain breaking changes; they are always listed under a is refused. `oxidelake_planner::codec::PLAN_FINGERPRINT` and `build_description()` are public, and `make test-mixed-build` runs both cases with real binaries. + - **A `GROUP BY` under a GPU target holds its groups, not its input** (#29). `GpuAggregateExec` collected each input partition whole before aggregating, so every grouped aggregate on a `cuda` or `metal` target, and @@ -550,7 +575,6 @@ versions (0.x) may contain breaking changes; they are always listed under a `GpuOperator::aggregate_into` and `oxidelake_device::cpu::kernels::GroupedAggregator`. - - **`OxideFrame::show()` no longer panics when stdout closes** (#125). It was DataFusion's `DataFrame::show`, whose `println!` panics on a closed pipe, so a program showing a frame into `… | head -1` died with `failed @@ -559,8 +583,6 @@ versions (0.x) may contain breaking changes; they are always listed under a reader that has gone is a clean stop that returns `Ok`, as `oxide sql` exits 0 there; any other write failure is an `EngineError::Io`. -### Fixed - - **A crates.io error can no longer switch the release's semver check off.** `release.yml` read every answer but HTTP 200 — a 429, a 503 — as "first release, no baseline" and skipped `cargo-semver-checks` minutes before @@ -568,6 +590,7 @@ versions (0.x) may contain breaking changes; they are always listed under a now fails unless crates.io confirms the baseline, after retrying a 429 or a 5xx; a release that hits an outage is re-run rather than published unchecked (#130). + - **Re-running `binaries.yml` repairs a partly attached target.** The re-run guard looked for a target's archive alone, so a run that uploaded the archive and died before its `.sha256` or its unversioned alias left that @@ -575,12 +598,14 @@ versions (0.x) may contain breaking changes; they are always listed under a the missing checksum, without printing which. A target now counts as attached only when all four of its files are; the missing ones are recovered from the attached archive's own bytes, never rebuilt (#131). + - **`oxide tui --table Trips=…` opens the dashboard.** A table name with an upper-case letter is registered as DataFusion folds it, `trips`, but the column-profile query asked for `"Trips"`, so the dashboard failed with `table 'datafusion.public.Trips' not found` after the query itself had run. The profile query now names the table as registration resolved it (#120). + - **The Describe panel shows min and max for every column DataFusion can order.** It profiled `Int64`, `Float64` and `Utf8` only, and DataFusion reads Parquet strings as `Utf8View`, so string columns read from Parquet @@ -590,12 +615,14 @@ versions (0.x) may contain breaking changes; they are always listed under a type they cannot order (a `Map`) is left out instead of failing the profile; every numeric type now gets P25/P50/P99 too, not only `Int64` and `Float64` (#121). + - **The Inspector shows each operator its own counters.** `oxide tui --query` merged the hub's counters by operator name, so two operators of one name — a self-join's two filters — each showed the sum of both: a filter emitting 129 rows and one emitting 1451 both read `6000 in / 1580 out`. Each plan node's counters are now read from the node itself (#123). + - **A dashboard whose refresh brings the plan can select all of it.** `run_terminal` bounded the selection by the plan the model had before the first refresh, so with a tick and a `refresh` that supplies the plan @@ -605,6 +632,7 @@ versions (0.x) may contain breaking changes; they are always listed under a the last operator left when the plan shrinks under it. `oxide tui` never refreshes and was not affected. A loop of your own around `AppState` and `render` gets the same from the new `AppState::set_node_count` (#126). + - **The dashboard no longer cuts numbers at 80x24 or 120x40.** The Describe panel asked for 62 columns whatever it held, so in any terminal narrower than 128 every cell was clipped without a mark: the README's own @@ -618,17 +646,20 @@ versions (0.x) may contain breaking changes; they are always listed under a columns; it is `-1.2e-5`). At 24 rows the Inspector now keeps its `H2D / D2H` and `cpu fallback` lines, which needed 28, and Telemetry the line saying whether its gauges can move at all, which needed 26 (#122). + - **CI's `msrv` job compiles with the declared minimum Rust.** It installed 1.94.1 and then ran a plain `cargo check`, which rustup resolved through `rust-toolchain.toml` to 1.98.0, so the job could not fail on code that needs a newer compiler; `rust-version` was checked only by a local `make msrv`. The job now runs `make msrv` under `RUSTUP_TOOLCHAIN` and first asserts which `rustc` is in use (#127). + - **The `metrics` feature is linted and tested in CI.** No CI job and no `make gate` target built the Prometheus endpoint; only rustdoc and `cargo deny` saw it, through `--all-features`, and rustdoc does not type-check function bodies. `make lint-metrics` and `make test-metrics` are now in the gate and in CI's clippy and Linux test matrices (#128). + - **Every link on the nine crates.io pages works.** Each crate's README is the workspace README, and crates.io resolves a relative link against that crate's own directory, so all 28 relative targets in it (`docs/SPEC.md`, @@ -636,6 +667,7 @@ versions (0.x) may contain breaking changes; they are always listed under a README now links with absolute GitHub URLs, and `make crate-metadata` fails on a relative link or on a link into this repository that names a path it does not have (#129). + - **The documentation describes the code that exists** (#132). The spill manager has no watermarks, no background demotion and no throughput metric: the call that takes a tier over its byte budget demotes its least @@ -770,6 +802,7 @@ versions (0.x) may contain breaking changes; they are always listed under a scan with DataFusion's own reader. `register_local_store` now puts the store behind the new `BoundedReadStore`, which refuses a multi-range read past the end of an object before the store underneath reserves memory for it. + - **A corrupt Arrow IPC file is refused instead of panicking or aborting the process** (#110). `read_ipc_file` and the spill reader (`oxidelake_memory::ipc::decode_batch`) handed the file to arrow-ipc, @@ -1280,7 +1313,8 @@ Metal executes on Apple silicon (verified on an M4 Pro and on GitHub's macOS runners); CUDA compiles and lints without a CUDA installation but has not yet run on a CUDA machine. -[Unreleased]: https://github.com/vyncint/oxidelake/compare/v0.2.0...HEAD +[Unreleased]: https://github.com/vyncint/oxidelake/compare/v0.3.0...HEAD +[0.3.0]: https://github.com/vyncint/oxidelake/compare/v0.2.0...v0.3.0 [0.2.0]: https://github.com/vyncint/oxidelake/compare/v0.1.4...v0.2.0 [0.1.4]: https://github.com/vyncint/oxidelake/compare/v0.1.3...v0.1.4 [0.1.3]: https://github.com/vyncint/oxidelake/compare/v0.1.2...v0.1.3 From f2fd8adf0f08f01ca8b39caeb2ea3a745b5acfdf Mon Sep 17 00:00:00 2001 From: Vyncint Ng <115854244+vyncint@users.noreply.github.com> Date: Wed, 18 Nov 2026 17:56:40 +0700 Subject: [PATCH 6/6] test(runtime): serialize the cluster tests that share the process-wide hub MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The witnesses in tests/cluster.rs count the Gpu*Exec operators the process-wide telemetry hub registered from an id on, and the file's tests run in parallel threads of one process. On the release PR's macOS runner, the_static_planner_runs_lowered_nodes_correctly counted two GpuHashJoinExec of 2019 rows each where its COUNT(*) join ran one: distributed_results_equal_embedded_results was running the same t ⋈ r join at the same moment. The rows were right; the witness was not. Every test that runs queries on a cluster now holds one tokio mutex for its whole run (tokio's, because the guard lives across awaits). Three local runs of --test cluster: 7 passed each, about 8 s, up from 2 s. Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com> --- crates/oxidelake-runtime/tests/cluster.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/crates/oxidelake-runtime/tests/cluster.rs b/crates/oxidelake-runtime/tests/cluster.rs index 11361dd..ffce0d5 100644 --- a/crates/oxidelake-runtime/tests/cluster.rs +++ b/crates/oxidelake-runtime/tests/cluster.rs @@ -137,6 +137,22 @@ async fn explained_gpu_operators(session: &OxideSession, sql: &str) -> BTreeSet< names } +/// Held by every test here that runs queries on a cluster, for its whole run. +/// +/// The witnesses below read the process-wide hub from an id on, and the +/// tests run in parallel threads of this one process. So another test's +/// `Gpu*Exec`, registered inside that window, used to be counted as this +/// test's own. On a macOS runner, `the_static_planner_runs_lowered_nodes_correctly` +/// saw two `GpuHashJoinExec` of 2019 rows where its query ran one: +/// `distributed_results_equal_embedded_results` joins the same `t` and `r`. +/// A `tokio` mutex, because the guard is held across `.await`s. +async fn hub_window() -> tokio::sync::MutexGuard<'static, ()> { + static LOCK: std::sync::OnceLock> = std::sync::OnceLock::new(); + LOCK.get_or_init(|| tokio::sync::Mutex::new(())) + .lock() + .await +} + /// The next registration id of the process-wide hub: operators registered /// from here on have an id at least this large. fn next_operator_id() -> usize { @@ -186,6 +202,7 @@ fn assert_executed_on_an_executor(since: usize, names: &BTreeSet, sql: & /// cluster, and every operator that names must then have run. #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn distributed_results_equal_embedded_results() { + let _hub = hub_window().await; let dir = tempfile::tempdir().unwrap(); let (t_path, r_path) = write_dataset(dir.path()); @@ -241,6 +258,7 @@ async fn distributed_results_equal_embedded_results() { /// needed. This pins the answer, not either mechanism. #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn not_in_a_subquery_is_null_aware_on_a_cluster() { + let _hub = hub_window().await; let dir = tempfile::tempdir().unwrap(); let (t_path, r_path) = write_dataset(dir.path()); @@ -325,6 +343,7 @@ async fn largest_batch(session: &OxideSession, path: &str) -> usize { /// "default means unset" rule would get wrong. #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn the_batch_size_a_client_asks_for_reaches_a_gpu_cluster() { + let _hub = hub_window().await; let dir = tempfile::tempdir().unwrap(); let path = write_rows(dir.path(), 20_000); let addr = start_standalone(BackendKind::Cuda, 2, 2).await.unwrap(); @@ -420,6 +439,7 @@ const PARTITIONED_JOINS: [&str; 2] = [ #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn aggregates_keep_their_partitioning_on_a_cluster() { + let _hub = hub_window().await; let dir = tempfile::tempdir().unwrap(); let (t_path, _) = write_dataset(dir.path()); @@ -528,6 +548,7 @@ fn ran_since(since: usize, name: &str) -> (usize, u64) { /// lowered node it is about ran on the executors. #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn the_static_planner_runs_lowered_nodes_correctly() { + let _hub = hub_window().await; let dir = tempfile::tempdir().unwrap(); let (t_path, r_path) = write_dataset(dir.path()); let addr = start_standalone(BackendKind::Cuda, 2, 2).await.unwrap();