Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- run: mkdir -p target/wheel-data
- uses: PyO3/maturin-action@v1
with:
command: sdist
Expand Down
2 changes: 1 addition & 1 deletion DEV.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Run `cargo fmt --check` after Rust edits and `chkstyle` after Python edits once

The normal release test path decodes selected valid and corrupt cases from the maintained upstream `bzip2-testfiles` collection. Generated byte distributions add differential coverage. Valid outputs are compared byte-for-byte with `libbz2-rs-sys`, which is a dev-only oracle and never part of production decoding.

The same test binary contains a warmed end-to-end performance gate requiring `fastbz2` to complete a representative workload within 1.2 times the oracle. Keep the whole release test suite below five seconds on the primary development laptop; individual timed workloads should normally be about 0.1 seconds or less. Use the Simple English Wikipedia dump for heavier local throughput, scaling, memory, and time-to-first-output checks. `librapidarchive` was a one-time design comparison, not a retained baseline.
The same test binary contains a warmed end-to-end performance regression gate capped at 1.3 times the oracle, allowing for noise on shared runners. Representative local acceptance remains 1.2 times the oracle. Keep the whole release test suite below five seconds on the primary development laptop; individual timed workloads should normally be about 0.1 seconds or less. Use the Simple English Wikipedia dump for heavier local throughput, scaling, memory, and time-to-first-output checks. `librapidarchive` was a one-time design comparison, not a retained baseline.

Legacy randomized blocks produced by bzip2 versions before 0.9.5 are intentionally unsupported. Supporting that obsolete format would add complexity to the production decoder for data that is not realistically encountered today.

Expand Down
4 changes: 2 additions & 2 deletions tests/corpus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ fn elapsed(repeats: usize, mut decode: impl FnMut()) -> std::time::Duration {

#[test]
#[cfg(not(debug_assertions))]
fn performance_stays_within_twenty_percent_of_oracle() {
fn performance_regression_stays_bounded() {
let source = oracle_decompress(include_bytes!("corpus/go/Isaac.Newton-Opticks.txt.bz2")).unwrap();
let plain = source.repeat(2);
let encoded = compress(&plain, Level::FASTEST);
Expand All @@ -151,5 +151,5 @@ fn performance_stays_within_twenty_percent_of_oracle() {
let oracle_time = elapsed(repeats, || {
std::hint::black_box(oracle_decompress(&encoded).unwrap());
});
assert!(fastbz2_time.as_secs_f64() <= oracle_time.as_secs_f64() * 1.2, "fastbz2 {fastbz2_time:?} exceeded 1.2x oracle {oracle_time:?}");
assert!(fastbz2_time.as_secs_f64() <= oracle_time.as_secs_f64() * 1.3, "fastbz2 {fastbz2_time:?} exceeded 1.3x oracle {oracle_time:?}");
}