Skip to content

fix: gate remote job error construction behind the remote feature - #4233

Merged
Xuanwo merged 1 commit into
lancedb:mainfrom
SIDDARTHAREDDY8:bhai-blitz-3-lancedb-1
Oct 22, 2026
Merged

Xuanwo merged 1 commit into
lancedb:mainfrom
SIDDARTHAREDDY8:bhai-blitz-3-lancedb-1

Conversation

@SIDDARTHAREDDY8

Copy link
Copy Markdown
Contributor

Summary

Fixes #4142: lancedb failed to compile without the remote feature.

TerminalResult::decode in rust/lancedb/src/job.rs constructed the
Error::Http variant unconditionally, but that variant is declared behind
#[cfg(feature = "remote")] in rust/lancedb/src/error.rs. Since the
crate's default feature set is empty, a plain lancedb = "0.38" dependency
failed with:

error[E0599]: no variant named `Http` found for enum `error::Error`
  --> rust/lancedb/src/job.rs:102:40

The module itself is not remote-only (it carries local job support), so
instead of gating pub mod job, both Error::Http constructions now go
through a small remote_job_error helper that resolves to Error::Http
with the remote feature and falls back to Error::Runtime without it.
A request_id is only ever Some for remote jobs, so the fallback is
unreachable in practice without the feature.

Testing

  • Reproduced the reported failure on current main:
    cargo check -p lancedb --no-default-features failed with the exact
    E0599 errors from the issue before the change, and passes after it.
  • cargo check -p lancedb --features remote passes with no errors and no
    new warnings.
  • Added two regression tests in rust/lancedb/src/job.rs
    (decode_missing_result_uses_feature_appropriate_error,
    decode_unparsable_result_uses_feature_appropriate_error) asserting the
    error variant matches the feature configuration. The test code compiles
    under the fixed configuration (cargo check --tests passes), and the
    branching logic was executed standalone against both feature cfgs
    (3/3 green with and without remote). The full cargo test binary link
    could not complete on the small build VM available here (the linker
    stalled), so CI coverage of the new tests is appreciated.
  • cargo fmt --all -- --check is clean.

Disclosure

AI assistance was used while preparing this change (code search, editing,
and verification commands were agent-driven); the diagnosis, fix design,
and all test results above were verified by actually running the builds.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@github-actions github-actions Bot added bug Something isn't working Rust Rust related issues labels Sep 20, 2026

@lancedb-gatekeeper lancedb-gatekeeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Gate recommendation: approve with a non-blocking risk.

The feature-aware helper restores the crate’s default/no-remote build while preserving request-ID-bearing Error::Http failures for remote typed jobs; the targeted tests pass in both configurations.

The remaining risk is regression durability: the existing workspace “without remote” workflow still enables remote through binding-crate feature unification, so the new non-remote branch is not exercised there. A package-scoped no-default-features check, as demonstrated in #4100, would close that gap; it is not a prerequisite to accept this fix.

@lancedb-gatekeeper lancedb-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. labels Sep 20, 2026
meta-codesync Bot pushed a commit to meta/sapling that referenced this pull request Oct 5, 2026
Summary:
Upgrading `lancedb` from `0.37.1-beta.1` to `0.40.0-beta.12` (git rev `3d8c9e2ddc61ce819f42bd56c4b56ee0fd4ae769`), and the lance crate family from `11.0.0-beta.3` to `13.1.0-beta.1` (github.com/fbsource/lance `e5a3553b1699a7062ff7afe4ee268d596bbf2e0d`, tag v13.1.0-beta.1).
- Purpose: pulls in lance-format/lance#9148 (`e6a3e8f3d099`), which stops an unindexed filtered scan from eagerly decoding `List<Float32>` columns for every row of every fragment. Verified with a model-free lancedb repro (12 fragments x 8 rows x 4 KiB `List<Float32>`, filter `id IN (...)`): the filter-phase scan now projects `[id, n_tokens, token_dim]` with bytes_read 50.54 K, and `flat_vector` is taken late for the 3 matching rows only (12.53 K). On 11.0.0-beta.3 the filter phase projected `flat_vector` too and read 447.6 K.
- All 21 `[patch."https://github.com/lance-format/lance.git"]` entries moved to the new rev; autocargo regenerated the mirrored patch sections.
- New overlay `third-party/rust/fixups/lancedb/overlay/src/job.rs`: the vendored `job.rs` with exactly the hunks of upstream lancedb/lancedb#4233 (head `8d11d4ab649fb5634ad53d936c84db79aebb96cf`, still open) applied, fixing lancedb/lancedb#4142. lancedb >= 0.38 does not compile without its `remote` feature (`job.rs` constructs the `remote`-gated `Error::Http`); fbsource enables only `sentence-transformers`. Scoped to `=0.40.0-beta.12`; delete when the pinned lancedb contains #4233.
- `third-party/rust/fixups/lance-linalg`: compile the new AMX-FP16 kernel `src/simd/amx_fp16.c` as a `cxx_library` on x86_64 Linux with the build script's flags (same pattern as the existing `dist_table.c` entry). The build script sets `kernel_support="amx_fp16"`, but Buck2 does not link its cc output, which left `lance_amx_*` undefined at link time.
- `third-party/rust/fixups/lancedb`: async-trait `narrow_to` version selector moved to the new version (upstream still declares `async-trait = "0"`).
- Transitive: `lance-namespace-reqwest-client` 0.8.6 -> 0.13.0; `object_store` 0.14.2 added alongside 0.12.5/0.13.2. No other Cargo.lock changes.
- Reviewer note: on AMX-FP16 hosts (Granite Rapids+), lance 13 routes f16 dot products and IVF partition assignment through the AMX kernel, chosen at runtime via CPUID; `LANCE_DISABLE_AMX=1` restores the previous path.
- No fbcode fixes needed. All 144 Rust targets that transitively depend on `fbsource//third-party/rust:lancedb` were checked with arc rust-check: Bindle (99 targets) has 0 errors. semcode, perf_mcp and fbcode/scripts/czakian/pear fail with the same errors before and after this diff (pre-existing: fbsource `arrow` 57 vs lancedb's arrow 58.4.0, which is unchanged here; the `Table::add_columns` builder API; unrelated tree-sitter-python and sha2 breaks; pear has no sources).
- Bindle model-free ranking tests pass (27/27). Bindle lance storage tests show no regression against the base revision: the failures seen (ASAN stack overflows in checkpoint_integration_test, DeltaSealInProgress, a peak-RSS budget, a lease-transfer timeout, and a deprecated-API build failure in lancedb_multi_writer_test) all reproduce at base, where they are as frequent or more frequent.

Reviewed By: dtolnay

Differential Revision: D123262780

fbshipit-source-id: 2cc9059dbbe36b4cc691ffeaed786f31d16f0446
meta-codesync Bot pushed a commit to facebookexperimental/rust-shed that referenced this pull request Oct 5, 2026
Summary:
Upgrading `lancedb` from `0.37.1-beta.1` to `0.40.0-beta.12` (git rev `3d8c9e2ddc61ce819f42bd56c4b56ee0fd4ae769`), and the lance crate family from `11.0.0-beta.3` to `13.1.0-beta.1` (github.com/fbsource/lance `e5a3553b1699a7062ff7afe4ee268d596bbf2e0d`, tag v13.1.0-beta.1).
- Purpose: pulls in lance-format/lance#9148 (`e6a3e8f3d099`), which stops an unindexed filtered scan from eagerly decoding `List<Float32>` columns for every row of every fragment. Verified with a model-free lancedb repro (12 fragments x 8 rows x 4 KiB `List<Float32>`, filter `id IN (...)`): the filter-phase scan now projects `[id, n_tokens, token_dim]` with bytes_read 50.54 K, and `flat_vector` is taken late for the 3 matching rows only (12.53 K). On 11.0.0-beta.3 the filter phase projected `flat_vector` too and read 447.6 K.
- All 21 `[patch."https://github.com/lance-format/lance.git"]` entries moved to the new rev; autocargo regenerated the mirrored patch sections.
- New overlay `third-party/rust/fixups/lancedb/overlay/src/job.rs`: the vendored `job.rs` with exactly the hunks of upstream lancedb/lancedb#4233 (head `8d11d4ab649fb5634ad53d936c84db79aebb96cf`, still open) applied, fixing lancedb/lancedb#4142. lancedb >= 0.38 does not compile without its `remote` feature (`job.rs` constructs the `remote`-gated `Error::Http`); fbsource enables only `sentence-transformers`. Scoped to `=0.40.0-beta.12`; delete when the pinned lancedb contains #4233.
- `third-party/rust/fixups/lance-linalg`: compile the new AMX-FP16 kernel `src/simd/amx_fp16.c` as a `cxx_library` on x86_64 Linux with the build script's flags (same pattern as the existing `dist_table.c` entry). The build script sets `kernel_support="amx_fp16"`, but Buck2 does not link its cc output, which left `lance_amx_*` undefined at link time.
- `third-party/rust/fixups/lancedb`: async-trait `narrow_to` version selector moved to the new version (upstream still declares `async-trait = "0"`).
- Transitive: `lance-namespace-reqwest-client` 0.8.6 -> 0.13.0; `object_store` 0.14.2 added alongside 0.12.5/0.13.2. No other Cargo.lock changes.
- Reviewer note: on AMX-FP16 hosts (Granite Rapids+), lance 13 routes f16 dot products and IVF partition assignment through the AMX kernel, chosen at runtime via CPUID; `LANCE_DISABLE_AMX=1` restores the previous path.
- No fbcode fixes needed. All 144 Rust targets that transitively depend on `fbsource//third-party/rust:lancedb` were checked with arc rust-check: Bindle (99 targets) has 0 errors. semcode, perf_mcp and fbcode/scripts/czakian/pear fail with the same errors before and after this diff (pre-existing: fbsource `arrow` 57 vs lancedb's arrow 58.4.0, which is unchanged here; the `Table::add_columns` builder API; unrelated tree-sitter-python and sha2 breaks; pear has no sources).
- Bindle model-free ranking tests pass (27/27). Bindle lance storage tests show no regression against the base revision: the failures seen (ASAN stack overflows in checkpoint_integration_test, DeltaSealInProgress, a peak-RSS budget, a lease-transfer timeout, and a deprecated-API build failure in lancedb_multi_writer_test) all reproduce at base, where they are as frequent or more frequent.

Reviewed By: dtolnay

Differential Revision: D123262780

fbshipit-source-id: 2cc9059dbbe36b4cc691ffeaed786f31d16f0446
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. Rust Rust related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0.38.0 does not compile without the remote feature: job.rs uses the remote-gated Error::Http variant

2 participants