Skip to content

Rust implementation is incorrectly compresses to &[] #54

@CommanderStorm

Description

@CommanderStorm

Here is the repro

use fastpfor::rust::{FastPFOR, Integer, BLOCK_SIZE_128, DEFAULT_PAGE_SIZE};
use std::io::Cursor;

let input = vec![42u32];
let mut codec = FastPFOR::new(DEFAULT_PAGE_SIZE, BLOCK_SIZE_128);
let mut compressed = vec![0u32; 1024];

let mut output_cur = Cursor::new(0);
codec.compress(&input, input.len() as u32, &mut Cursor::new(0), &mut compressed, &mut output_cur).unwrap();
assert!(output_cur.position() != 0); // Fails! We have compressed something to nothing :(

let mut decompressed = vec![0u32; 1024];
codec.uncompress(&compressed, output_cur.position(), &mut Cursor::new(0), &mut decompressed, &mut Cursor::new(0)).unwrap();

assert_eq!(decompressed, input);  // FAILS Input [42] -> Output []

for more of these testcases (I could not get to a point where I know what is), please see

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions