Skip to content

refactor(engine): extract spill/buffer.rs (SPL-4 #2326) - #4426

Closed
oferchen wants to merge 1 commit into
masterfrom
feature/spl-4-buffer-extract
Closed

oferchen wants to merge 1 commit into
masterfrom
feature/spl-4-buffer-extract

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Move SpillableReorderBuffer<T> and its impl block from spill.rs into the new spill/buffer.rs submodule per the SPL-1 audit's leaves-first order.
  • Parent spill.rs re-exports SpillableReorderBuffer so the public API at crate::concurrent_delta::spill::SpillableReorderBuffer is unchanged.
  • Buffer-specific tests (in-memory/spill/reload round-trips, threshold boundary, ENOSPC and temp-dir-vanish hardening, directory-backed round-trip, partial-write contract) move with the type. The codec round-trip tests for DeltaResult and the SpillError Display/source test stay in the parent.
  • SpillBackend, ReadWriteSeek, and open_backend are reduced to pub(super) so the new submodule can call them without widening the public surface.

Note: buffer.rs LoC

  • Parent spill.rs shrinks from 1232 to 282 lines (well under the 650 cap).
  • spill/buffer.rs lands at 972 lines: ~390 lines of code plus ~580 lines of tests. The tests are tightly coupled to the buffer (FailingCodec, impl SpillCodec for u64, scratch-tempdir scenarios) and split poorly. Splitting the test module would create a second file whose only consumer is itself; SPL-5/SPL-7 will revisit this once stats/codec extractions reshape the buffer surface.

Test plan

  • cargo fmt --all clean
  • cargo check -p engine --all-features --tests clean (no new warnings vs master)
  • cargo clippy -p engine --all-targets --all-features --no-deps -- -D warnings clean (no new lints vs master)
  • No public-API change: SPL-9 audit table (docs/audits/spl-9-mod-reexports.md) entries for SpillableReorderBuffer + 12 inherent methods still resolve at crate::concurrent_delta::spill::SpillableReorderBuffer::* via the parent re-export.

Closes #2326.

@oferchen
oferchen force-pushed the feature/spl-4-buffer-extract branch from b636cbc to 72a914e Compare May 18, 2026 00:55
oferchen added a commit that referenced this pull request May 18, 2026
Test-only extraction from spill.rs leaves the parent at 693 LoC
(691 non-test + 2 for the test mod declaration), still over the
650 LoC cap. SPL-3 (PR #4434) and SPL-4 (PR #4426) remain open on
master; SPL-8 is unblocked once SPL-4 lands (parent drops to ~282
LoC per that PR body).
oferchen added a commit that referenced this pull request May 18, 2026
Test-only extraction from spill.rs leaves the parent at 693 LoC
(691 non-test + 2 for the test mod declaration), still over the
650 LoC cap. SPL-3 (PR #4434) and SPL-4 (PR #4426) remain open on
master; SPL-8 is unblocked once SPL-4 lands (parent drops to ~282
LoC per that PR body).
@oferchen

Copy link
Copy Markdown
Owner Author

Needs to be redone against current master. Since this PR was opened, STN-3 (spill_dir), STN-4 (reclaim), STN-5 (granularity), STN-6 (memory_pressure), STN-7 (compression) all added methods to SpillableReorderBuffer that this PR's extracted spill/buffer.rs is missing. Mechanical conflict resolution would lose those methods. A fresh extraction off latest master is the right path.

@oferchen oferchen closed this May 18, 2026
oferchen added a commit that referenced this pull request May 18, 2026
Test-only extraction from spill.rs leaves the parent at 693 LoC
(691 non-test + 2 for the test mod declaration), still over the
650 LoC cap. SPL-3 (PR #4434) and SPL-4 (PR #4426) remain open on
master; SPL-8 is unblocked once SPL-4 lands (parent drops to ~282
LoC per that PR body).
oferchen added a commit that referenced this pull request May 18, 2026
Test-only extraction from spill.rs leaves the parent at 693 LoC
(691 non-test + 2 for the test mod declaration), still over the
650 LoC cap. SPL-3 (PR #4434) and SPL-4 (PR #4426) remain open on
master; SPL-8 is unblocked once SPL-4 lands (parent drops to ~282
LoC per that PR body).
@oferchen
oferchen deleted the feature/spl-4-buffer-extract branch May 19, 2026 15:13
oferchen added a commit that referenced this pull request Aug 24, 2026
Test-only extraction from spill.rs leaves the parent at 693 LoC
(691 non-test + 2 for the test mod declaration), still over the
650 LoC cap. SPL-3 (PR #4434) and SPL-4 (PR #4426) remain open on
master; SPL-8 is unblocked once SPL-4 lands (parent drops to ~282
LoC per that PR body).
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