Skip to content

refactor(engine): extract spill/error.rs (SPL-2 #2324) - #4345

Merged
oferchen merged 1 commit into
masterfrom
refactor/spill-extract-error
May 18, 2026
Merged

oferchen merged 1 commit into
masterfrom
refactor/spill-extract-error

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • First step of the spill.rs decomposition plan documented in docs/audits/spill-rs-decomposition-plan.md (PR docs(audits): spill.rs decomposition plan (#2323) #4337).
  • Promotes crates/engine/src/concurrent_delta/spill.rs to a directory module (spill/mod.rs) and extracts the smallest leaf - the SpillError enum plus its Display, Error, and From impls - into a dedicated spill/error.rs (78 lines).
  • Public surface is unchanged: engine::concurrent_delta::spill::SpillError and the re-exports from concurrent_delta/mod.rs continue to resolve via pub use error::SpillError.

Test plan

  • cargo check -p engine --all-features --tests passes locally (no new warnings).
  • cargo fmt --all clean.
  • CI: fmt+clippy, nextest (stable), Windows, macOS, Linux musl.

Refs SPL-2 #2324.

@oferchen
oferchen force-pushed the refactor/spill-extract-error branch 7 times, most recently from 62c7b78 to 58e10d0 Compare May 18, 2026 02:11
First step of the spill.rs decomposition plan. Moves the SpillError
enum and its Display/Error/From impls into a dedicated leaf module
under crates/engine/src/concurrent_delta/spill/error.rs.

spill.rs becomes spill/mod.rs and re-exports SpillError so the
existing public path `engine::concurrent_delta::spill::SpillError`
continues to resolve. No behavior or public API changes.

# Conflicts:
#	crates/engine/src/concurrent_delta/spill/mod.rs
@oferchen
oferchen force-pushed the refactor/spill-extract-error branch from 58e10d0 to 28bf9e2 Compare May 18, 2026 02:14
@oferchen
oferchen merged commit 9497d18 into master May 18, 2026
22 of 27 checks passed
@oferchen
oferchen deleted the refactor/spill-extract-error branch May 18, 2026 02:16
oferchen added a commit that referenced this pull request May 18, 2026
… (#4478)

Update Current-path column for SpillableReorderBuffer rows after
SPL-13 extracted them to spill/buffer.rs. Update SpillError rows after
SPL-2 (#4345) and SpillStats rows after SPL-6 (#4386). Add a History
section cross-linking the four extraction PRs (SPL-2, SPL-6,
SPL-3-tempfile, SPL-13) that have shipped. The 42-symbol public API
table remains at OK across all entries.
oferchen added a commit that referenced this pull request May 18, 2026
First step of the spill.rs decomposition plan. Moves the SpillError
enum and its Display/Error/From impls into a dedicated leaf module
under crates/engine/src/concurrent_delta/spill/error.rs.

spill.rs becomes spill/mod.rs and re-exports SpillError so the
existing public path `engine::concurrent_delta::spill::SpillError`
continues to resolve. No behavior or public API changes.

# Conflicts:
#	crates/engine/src/concurrent_delta/spill/mod.rs
oferchen added a commit that referenced this pull request May 18, 2026
… (#4478)

Update Current-path column for SpillableReorderBuffer rows after
SPL-13 extracted them to spill/buffer.rs. Update SpillError rows after
SPL-2 (#4345) and SpillStats rows after SPL-6 (#4386). Add a History
section cross-linking the four extraction PRs (SPL-2, SPL-6,
SPL-3-tempfile, SPL-13) that have shipped. The 42-symbol public API
table remains at OK across all entries.
oferchen added a commit that referenced this pull request May 18, 2026
First step of the spill.rs decomposition plan. Moves the SpillError
enum and its Display/Error/From impls into a dedicated leaf module
under crates/engine/src/concurrent_delta/spill/error.rs.

spill.rs becomes spill/mod.rs and re-exports SpillError so the
existing public path `engine::concurrent_delta::spill::SpillError`
continues to resolve. No behavior or public API changes.

# Conflicts:
#	crates/engine/src/concurrent_delta/spill/mod.rs
oferchen added a commit that referenced this pull request May 18, 2026
… (#4478)

Update Current-path column for SpillableReorderBuffer rows after
SPL-13 extracted them to spill/buffer.rs. Update SpillError rows after
SPL-2 (#4345) and SpillStats rows after SPL-6 (#4386). Add a History
section cross-linking the four extraction PRs (SPL-2, SPL-6,
SPL-3-tempfile, SPL-13) that have shipped. The 42-symbol public API
table remains at OK across all entries.
oferchen added a commit that referenced this pull request Jun 17, 2026
…d input

Add explicit min_bytes validation to read_varlong so a fuzzer-found or
caller-induced min_bytes==0 or min_bytes>8 surfaces as InvalidData instead
of panicking on usize subtract underflow at `min - 1` or slice OOB at
`initial[..min]`. The valid encodable range is 1..=8: upstream's `u.b`
union is 9 bytes wide and at least one byte is the leading tag.

upstream: io.c:1827 read_varlong() implicitly requires min_bytes >= 1
(it reads min_bytes including the leading tag and indexes b2[min_bytes-1]
plus u.b[min_bytes + extra - 1]). Bound is upstream's
`if (min_bytes + extra > (int)sizeof u.b)`.

Add regression tests covering:
- read_varlong with min_bytes==0 (underflow panic before guard)
- read_varlong with min_bytes>8 (slice OOB before guard)
- read_varint across the full 0xFC..=0xFF tag range (extra=5,5,6,6),
  each of which must surface InvalidData (matches upstream io.c:1809
  "Overflow in read_varint()")

No wire-protocol behavior change for legitimate inputs. Crosses with
PULL-VARINT (#4345) and CI-MASTER-FUZZ filter-fuzzer crashes.
oferchen added a commit that referenced this pull request Jun 17, 2026
…d input

Add explicit min_bytes validation to read_varlong so a fuzzer-found or
caller-induced min_bytes==0 or min_bytes>8 surfaces as InvalidData instead
of panicking on usize subtract underflow at `min - 1` or slice OOB at
`initial[..min]`. The valid encodable range is 1..=8: upstream's `u.b`
union is 9 bytes wide and at least one byte is the leading tag.

upstream: io.c:1827 read_varlong() implicitly requires min_bytes >= 1
(it reads min_bytes including the leading tag and indexes b2[min_bytes-1]
plus u.b[min_bytes + extra - 1]). Bound is upstream's
`if (min_bytes + extra > (int)sizeof u.b)`.

Add regression tests covering:
- read_varlong with min_bytes==0 (underflow panic before guard)
- read_varlong with min_bytes>8 (slice OOB before guard)
- read_varint across the full 0xFC..=0xFF tag range (extra=5,5,6,6),
  each of which must surface InvalidData (matches upstream io.c:1809
  "Overflow in read_varint()")

No wire-protocol behavior change for legitimate inputs. Crosses with
PULL-VARINT (#4345) and CI-MASTER-FUZZ filter-fuzzer crashes.
oferchen added a commit that referenced this pull request Jun 17, 2026
…d input (#5874)

Add explicit min_bytes validation to read_varlong so a fuzzer-found or
caller-induced min_bytes==0 or min_bytes>8 surfaces as InvalidData instead
of panicking on usize subtract underflow at `min - 1` or slice OOB at
`initial[..min]`. The valid encodable range is 1..=8: upstream's `u.b`
union is 9 bytes wide and at least one byte is the leading tag.

upstream: io.c:1827 read_varlong() implicitly requires min_bytes >= 1
(it reads min_bytes including the leading tag and indexes b2[min_bytes-1]
plus u.b[min_bytes + extra - 1]). Bound is upstream's
`if (min_bytes + extra > (int)sizeof u.b)`.

Add regression tests covering:
- read_varlong with min_bytes==0 (underflow panic before guard)
- read_varlong with min_bytes>8 (slice OOB before guard)
- read_varint across the full 0xFC..=0xFF tag range (extra=5,5,6,6),
  each of which must surface InvalidData (matches upstream io.c:1809
  "Overflow in read_varint()")

No wire-protocol behavior change for legitimate inputs. Crosses with
PULL-VARINT (#4345) and CI-MASTER-FUZZ filter-fuzzer crashes.
oferchen added a commit that referenced this pull request Aug 24, 2026
First step of the spill.rs decomposition plan. Moves the SpillError
enum and its Display/Error/From impls into a dedicated leaf module
under crates/engine/src/concurrent_delta/spill/error.rs.

spill.rs becomes spill/mod.rs and re-exports SpillError so the
existing public path `engine::concurrent_delta::spill::SpillError`
continues to resolve. No behavior or public API changes.

# Conflicts:
#	crates/engine/src/concurrent_delta/spill/mod.rs
oferchen added a commit that referenced this pull request Aug 24, 2026
… (#4478)

Update Current-path column for SpillableReorderBuffer rows after
SPL-13 extracted them to spill/buffer.rs. Update SpillError rows after
SPL-2 (#4345) and SpillStats rows after SPL-6 (#4386). Add a History
section cross-linking the four extraction PRs (SPL-2, SPL-6,
SPL-3-tempfile, SPL-13) that have shipped. The 42-symbol public API
table remains at OK across all entries.
oferchen added a commit that referenced this pull request Aug 24, 2026
…d input (#5874)

Add explicit min_bytes validation to read_varlong so a fuzzer-found or
caller-induced min_bytes==0 or min_bytes>8 surfaces as InvalidData instead
of panicking on usize subtract underflow at `min - 1` or slice OOB at
`initial[..min]`. The valid encodable range is 1..=8: upstream's `u.b`
union is 9 bytes wide and at least one byte is the leading tag.

upstream: io.c:1827 read_varlong() implicitly requires min_bytes >= 1
(it reads min_bytes including the leading tag and indexes b2[min_bytes-1]
plus u.b[min_bytes + extra - 1]). Bound is upstream's
`if (min_bytes + extra > (int)sizeof u.b)`.

Add regression tests covering:
- read_varlong with min_bytes==0 (underflow panic before guard)
- read_varlong with min_bytes>8 (slice OOB before guard)
- read_varint across the full 0xFC..=0xFF tag range (extra=5,5,6,6),
  each of which must surface InvalidData (matches upstream io.c:1809
  "Overflow in read_varint()")

No wire-protocol behavior change for legitimate inputs. Crosses with
PULL-VARINT (#4345) and CI-MASTER-FUZZ filter-fuzzer crashes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant