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
4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ harness = false
name = "throughput_bbw"
harness = false

[[bench]]
name = "throughput_lzr"
harness = false

[[bench]]
name = "throughput_lzf"
harness = false
Expand Down
32 changes: 16 additions & 16 deletions benches/stages_match_finders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ fn bench_match_finding(c: &mut Criterion) {
group.finish();
}

/// Pipeline roundtrip: {hashchain, sortlz} x {greedy, lazy, optimal} on Lzr.
fn bench_pipeline_lzr(c: &mut Criterion) {
/// Pipeline roundtrip: {hashchain, sortlz} x {greedy, lazy, optimal} on LzSeqR.
fn bench_pipeline_lzseqr(c: &mut Criterion) {
use pz::pipeline::{self, CompressOptions, MatchFinder, ParseStrategy, Pipeline};

let mut group = c.benchmark_group("lzr_match_finders");
let mut group = c.benchmark_group("lzseqr_match_finders");
cap(&mut group);

let size = 65536;
Expand All @@ -63,7 +63,7 @@ fn bench_pipeline_lzr(c: &mut Criterion) {
..Default::default()
};
group.bench_with_input(BenchmarkId::new(&label, size), &data, |b, data| {
b.iter(|| pipeline::compress_with_options(data, Pipeline::Lzr, &opts).unwrap());
b.iter(|| pipeline::compress_with_options(data, Pipeline::LzSeqR, &opts).unwrap());
});
}
}
Expand Down Expand Up @@ -98,7 +98,7 @@ fn bench_ratio_comparison(c: &mut Criterion) {
..Default::default()
};
group.bench_with_input(BenchmarkId::new(name, size), &data, |b, data| {
b.iter(|| pipeline::compress_with_options(data, Pipeline::Lzr, &opts).unwrap());
b.iter(|| pipeline::compress_with_options(data, Pipeline::LzSeqR, &opts).unwrap());
});
}
group.finish();
Expand Down Expand Up @@ -154,36 +154,36 @@ fn bench_gpu_match_finding(c: &mut Criterion) {
}
group.finish();

// --- Part 2: Full Lzr pipeline with GPU sortlz match finder ---
let mut group = c.benchmark_group("lzr_gpu_match_finders");
// --- Part 2: Full LzSeqR pipeline with GPU sortlz match finder ---
let mut group = c.benchmark_group("lzseqr_gpu_match_finders");
cap(&mut group);

for &size in GPU_SIZES {
let data = get_test_data(size);
group.throughput(Throughput::Bytes(size as u64));

// CPU hashchain + Lzr
// CPU hashchain + LzSeqR
let opts = CompressOptions {
parse_strategy: ParseStrategy::Lazy,
threads: 1,
..Default::default()
};
group.bench_with_input(BenchmarkId::new("cpu_hashchain", size), &data, |b, data| {
b.iter(|| pipeline::compress_with_options(data, Pipeline::Lzr, &opts).unwrap());
b.iter(|| pipeline::compress_with_options(data, Pipeline::LzSeqR, &opts).unwrap());
});

// CPU sortlz + Lzr
// CPU sortlz + LzSeqR
let opts = CompressOptions {
match_finder: MatchFinder::SortLz,
parse_strategy: ParseStrategy::Lazy,
threads: 1,
..Default::default()
};
group.bench_with_input(BenchmarkId::new("cpu_sortlz", size), &data, |b, data| {
b.iter(|| pipeline::compress_with_options(data, Pipeline::Lzr, &opts).unwrap());
b.iter(|| pipeline::compress_with_options(data, Pipeline::LzSeqR, &opts).unwrap());
});

// GPU sortlz + Lzr (GPU match finding, CPU parse + entropy)
// GPU sortlz + LzSeqR (GPU match finding, CPU parse + entropy)
let eng = engine.clone();
group.bench_with_input(
BenchmarkId::new("gpu_sortlz", size),
Expand All @@ -197,13 +197,13 @@ fn bench_gpu_match_finding(c: &mut Criterion) {
threads: 1,
..Default::default()
};
b.iter(|| pipeline::compress_with_options(data, Pipeline::Lzr, &opts).unwrap());
b.iter(|| pipeline::compress_with_options(data, Pipeline::LzSeqR, &opts).unwrap());
},
);
}
group.finish();

// --- Part 3: Cross-pipeline GPU sortlz (Deflate, Lzr, Lzf) at 256K ---
// --- Part 3: Cross-pipeline GPU sortlz (Deflate, LzSeqR, Lzf) at 256K ---
let mut group = c.benchmark_group("gpu_sortlz_pipelines");
cap(&mut group);

Expand All @@ -213,7 +213,7 @@ fn bench_gpu_match_finding(c: &mut Criterion) {

for (name, pipeline) in [
("deflate", Pipeline::Deflate),
("lzr", Pipeline::Lzr),
("lzseqr", Pipeline::LzSeqR),
("lzf", Pipeline::Lzf),
] {
// CPU hashchain baseline
Expand Down Expand Up @@ -257,7 +257,7 @@ fn bench_gpu_match_finding(_c: &mut Criterion) {}
criterion_group!(
benches,
bench_match_finding,
bench_pipeline_lzr,
bench_pipeline_lzseqr,
bench_ratio_comparison,
bench_gpu_match_finding
);
Expand Down
23 changes: 0 additions & 23 deletions benches/throughput_lzr.rs

This file was deleted.

4 changes: 2 additions & 2 deletions examples/bench_recoil.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ fn main() {
..Default::default()
};
let compressed_std =
pipeline::compress_with_options(data, Pipeline::Lzr, &opts_std).unwrap();
pipeline::compress_with_options(data, Pipeline::LzSeqR, &opts_std).unwrap();
let cref = &compressed_std;
eprintln!(
" compressed: {:.1} KB (ratio {:.1}%)",
Expand All @@ -213,7 +213,7 @@ fn main() {
..Default::default()
};
let compressed_recoil =
pipeline::compress_with_options(data, Pipeline::Lzr, &opts_recoil).unwrap();
pipeline::compress_with_options(data, Pipeline::LzSeqR, &opts_recoil).unwrap();
let cref_r = &compressed_recoil;
bench_decode_fn(
"LZR + Recoil (16 splits, CPU thread::scope)",
Expand Down
3 changes: 1 addition & 2 deletions examples/pipeline_comparison.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ fn test_pipeline_comparison(name: &str, data: Vec<u8>) {
println!("{:-<80}", "");

let pipelines = vec![
("Lzr (LZ77+rANS)", Pipeline::Lzr),
("Lzf (LZ77+FSE)", Pipeline::Lzf),
("Lzf (LzSeq+FSE)", Pipeline::Lzf),
("LzSeqR (LzSeq+rANS)", Pipeline::LzSeqR),
("Deflate (LZ77+Huffman)", Pipeline::Deflate),
];
Expand Down
7 changes: 4 additions & 3 deletions examples/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ fn usage() {
eprintln!("Usage: profile [OPTIONS]");
eprintln!();
eprintln!("Options:");
eprintln!(" --pipeline P Pipeline: deflate, bw, bbw, lzr, lzf, lzfi, lzssr, lzseqr (default: lzf)");
eprintln!(
" --pipeline P Pipeline: deflate, bw, bbw, lzf, lzfi, lzssr, lzseqr (default: lzf)"
);
eprintln!(" --stage S Profile a single stage instead of full pipeline:");
eprintln!(" lz77, huffman, bwt, mtf, rle, fse, rans");
eprintln!(" --decompress Profile decompression instead of compression");
Expand Down Expand Up @@ -605,14 +607,13 @@ fn main() {
"deflate" => Pipeline::Deflate,
"bw" => Pipeline::Bw,
"bbw" => Pipeline::Bbw,
"lzr" => Pipeline::Lzr,
"lzf" => Pipeline::Lzf,
"lzfi" => Pipeline::Lzfi,
"lzssr" => Pipeline::LzssR,
"lzseqr" => Pipeline::LzSeqR,
other => {
eprintln!("unknown pipeline: {}", other);
eprintln!("valid pipelines: deflate, bw, bbw, lzr, lzf, lzfi, lzssr, lzseqr");
eprintln!("valid pipelines: deflate, bw, bbw, lzf, lzfi, lzssr, lzseqr");
std::process::exit(1);
}
};
Expand Down
6 changes: 3 additions & 3 deletions examples/profile_decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ fn profile_bw_decode(data: &[u8], label: &str) {
);
}

fn profile_lzr_decode(data: &[u8], label: &str) {
fn profile_lzseqr_decode(data: &[u8], label: &str) {
use pz::pipeline::{self, CompressOptions, Pipeline};

let opts = CompressOptions {
threads: 1,
..Default::default()
};
let compressed = pipeline::compress_with_options(data, Pipeline::Lzr, &opts).unwrap();
let compressed = pipeline::compress_with_options(data, Pipeline::LzSeqR, &opts).unwrap();

let iters = 10;
let mut total_ns = 0u128;
Expand Down Expand Up @@ -120,7 +120,7 @@ fn main() {
match std::fs::read(path) {
Ok(data) => {
profile_bw_decode(&data, label);
profile_lzr_decode(&data, label);
profile_lzseqr_decode(&data, label);
profile_deflate_decode(&data, label);
println!();
}
Expand Down
12 changes: 6 additions & 6 deletions examples/slz_debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@ fn main() {
Err(e) => println!("two 128KB hc: COMPRESS ERROR {:?}", e),
}

// Test 4: Multi-block LzR with sortlz (this works in benchmark)
match pipeline::compress_with_options(two_blocks, Pipeline::Lzr, &opts2) {
// Test 4: Multi-block LzSeqR with sortlz
match pipeline::compress_with_options(two_blocks, Pipeline::LzSeqR, &opts2) {
Ok(c) => match pipeline::decompress(&c) {
Ok(d) if d == two_blocks => println!(
"two 128KB lzr-slz: OK {:.1}%",
"two 128KB lzseqr-slz: OK {:.1}%",
c.len() as f64 / two_blocks.len() as f64 * 100.0
),
Ok(d) => println!("two 128KB lzr-slz: MISMATCH len={}", d.len()),
Err(e) => println!("two 128KB lzr-slz: DECOMPRESS ERROR {:?}", e),
Ok(d) => println!("two 128KB lzseqr-slz: MISMATCH len={}", d.len()),
Err(e) => println!("two 128KB lzseqr-slz: DECOMPRESS ERROR {:?}", e),
},
Err(e) => println!("two 128KB lzr-slz: COMPRESS ERROR {:?}", e),
Err(e) => println!("two 128KB lzseqr-slz: COMPRESS ERROR {:?}", e),
}
}
2 changes: 0 additions & 2 deletions examples/sortlz_lzseq_eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ fn main() {
let configs: Vec<(Pipeline, MatchFinder, &str)> = vec![
(Pipeline::Deflate, MatchFinder::HashChain, "deflate"),
(Pipeline::Bw, MatchFinder::HashChain, "bw"),
(Pipeline::Lzr, MatchFinder::HashChain, "lzr-hc"),
(Pipeline::Lzr, MatchFinder::SortLz, "lzr-slz"),
(Pipeline::LzSeqR, MatchFinder::HashChain, "lzseqr-hc"),
(Pipeline::LzSeqR, MatchFinder::SortLz, "lzseqr-slz"),
(Pipeline::LzSeqH, MatchFinder::HashChain, "lzseqh-hc"),
Expand Down
1 change: 0 additions & 1 deletion fuzz/fuzz_targets/fuzz_pipeline_roundtrip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ fuzz_target!(|data: &[u8]| {
Pipeline::Deflate,
Pipeline::Bw,
Pipeline::Bbw,
Pipeline::Lzr,
Pipeline::Lzf,
Pipeline::Lzfi,
Pipeline::LzssR,
Expand Down
2 changes: 1 addition & 1 deletion scripts/analyze-ratio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ gap_pct=$(awk "BEGIN { printf \"%.2f%%\", (($PZ_SIZE - $GZ_SIZE) / $ORIG_SIZE) *

# Pipeline category: LZ-based or BWT-based (affects interpretation of gap)
case "$PIPELINE" in
deflate|lzr|lzf|lzfi|lzseqr|lzseqh|lzssr|lz78r)
deflate|lzf|lzfi|lzseqr|lzseqh|lzssr|sortlz)
PIPELINE_CLASS="LZ-based" ;;
bw|bbw)
PIPELINE_CLASS="BWT-based" ;;
Expand Down
10 changes: 5 additions & 5 deletions scripts/bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Usage:
Options:
-n, --iters N Number of iterations per operation (default: 3)
-p, --pipelines LIST Comma-separated list of pipelines to benchmark
(default: deflate,lzr,lzf)
(default: deflate,lzf,lzseqr)
-t, --threads N Pass thread count to pz (-t N; 0=auto, 1=single-threaded)
--all Benchmark all available pipelines
--pareto Single-thread Pareto table: all pipelines + all competitors,
Expand All @@ -52,7 +52,7 @@ Examples:
./scripts/bench.sh # all corpus, all pipelines
./scripts/bench.sh myfile.bin # specific file
./scripts/bench.sh -p deflate,lzf # subset of pipelines
./scripts/bench.sh -t 1 -p lzr # force single-threaded pz
./scripts/bench.sh -t 1 -p lzseqr # force single-threaded pz
./scripts/bench.sh -n 10 # more iterations
./scripts/bench.sh --webgpu -p bw,bbw # GPU-accelerated via WebGPU
./scripts/bench.sh --all # benchmark every pipeline
Expand Down Expand Up @@ -101,7 +101,7 @@ while [[ $# -gt 0 ]]; do
shift 2
;;
--all)
PIPELINES=(deflate bw bbw lzr lzf lzfi lzseqr lzseqh sortlz)
PIPELINES=(deflate bw bbw lzf lzfi lzseqr lzseqh sortlz)
shift
;;
--silesia)
Expand All @@ -110,7 +110,7 @@ while [[ $# -gt 0 ]]; do
;;
--pareto)
PARETO=true
PIPELINES=(deflate bw bbw lzr lzf lzfi lzseqr lzseqh sortlz)
PIPELINES=(deflate bw bbw lzf lzfi lzseqr lzseqh sortlz)
# Force single-thread for apples-to-apples comparison
THREADS="1"
shift
Expand Down Expand Up @@ -151,7 +151,7 @@ done

# Default pipelines if none specified
if [[ ${#PIPELINES[@]} -eq 0 ]]; then
PIPELINES=(deflate lzr lzf)
PIPELINES=(deflate lzf lzseqr)
fi

# Collect input files from corpus if none given on command line
Expand Down
2 changes: 0 additions & 2 deletions scripts/gpu-experiment-bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,9 @@ PIPELINES=(
deflate
bw
bbw
lzr
lzf
lzfi
lzssr
lz78r
lzseqr
lzseqh
sortlz
Expand Down
4 changes: 2 additions & 2 deletions scripts/perf-gate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ SIZE=1048576
ITERATIONS=20
REPEATS=3
THREADS=0
PIPELINES_CSV="deflate,lzr,lzf,lzseqr"
PIPELINES_CSV="deflate,lzf,lzseqr"
CPU_ONLY=false
UPDATE_BASELINE=false
THROUGHPUT_REGRESSION_PCT=4.0
Expand All @@ -39,7 +39,7 @@ Options:
--iterations N profile-example loop iterations per run (default: 20)
--repeats N repeated runs per case; must be odd (default: 3)
--threads N pass thread count to profile (0=auto, default: 0)
--pipelines LIST comma-separated pipelines (default: deflate,lzr,lzf,lzseqr)
--pipelines LIST comma-separated pipelines (default: deflate,lzf,lzseqr)
--cpu-only skip WebGPU matrix
--cargo-profile NAME cargo profile for example binary (default: profiling)
--baseline FILE baseline TSV path
Expand Down
2 changes: 1 addition & 1 deletion scripts/profile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ BUILD OPTIONS:
--no-default-features Disable default features (pure CPU build)

PROFILE BINARY OPTIONS (forwarded to the profile example):
--pipeline P Pipeline: deflate, bw, bbw, lzr, lzf, lzfi, lzssr (default: lzf)
--pipeline P Pipeline: deflate, bw, bbw, lzf, lzfi, lzssr, lzseqr, lzseqh, sortlz (default: lzf)
--stage S Profile a single stage: lz77, huffman, bwt, mtf, rle, fse, rans
--decompress Profile decompression instead of compression
--iterations N Number of iterations (default: 200)
Expand Down
Loading