feat(compaction): add soft source budget mode - #8651
Open
everySympathy wants to merge 2 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
everySympathy
force-pushed
the
codex/compaction-soft-limit
branch
from
September 4, 2026 05:55
28750d3 to
4d8a7e0
Compare
Contributor
There was a problem hiding this comment.
✅ Gate recommendation: approve.
The rebased change safely extends the existing hard source-budget contract with an opt-in soft mode: hard mode remains unchanged, while soft mode guarantees one-task progress and stops cleanly at an oversized or unknown-size boundary. The policy stays centralized in Rust and is exposed consistently through Python and Java.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SourceBudgetModefor compaction planning, withhardpreserving the existing behaviorsoftmode admit the first indivisible task when it exceeds a cumulativemax_source_*budget, then stop the planCompactionOptionsstreamsThis is a follow-up to #8234.
Motivation
A hard source budget can produce an empty compaction plan when the first indivisible task is larger than the configured per-run target. Repeated planning then makes no progress unless the user raises the budget.
Soft mode treats the budgets as workload targets instead of strict caps for the first task. It guarantees one task of progress while remaining conservative: once the first task is admitted because it is oversized (or its byte size is unavailable in an older manifest), planning stops.
Semantics
hardremains the default and is backward compatible.softalways admits the first task.hard.max_source_bytes, a missing recorded size is still an error inhardmode. Insoftmode, a missing size on the first task admits that task and stops.Testing
cargo test -p lance source_budget --lib(5 passed)cargo test -p lance max_source --lib(3 passed)cargo clippy -p lance --lib --no-deps -- -D warningscargo fmt --all -- --checkcd python && cargo checkcd java && ./mvnw -Dtest=CompactionTest -DforkCount=0 test(8 Java tests and 18 JNI Rust tests passed)The Python runtime pytest suite was not run locally because the environment could not download a missing dependency; the native extension compiled successfully and CI will run the Python suite.