Conversation
5e17bf8 to
33abcb5
Compare
5873c6a to
078499b
Compare
860975f to
7e9dfe8
Compare
|
@robertu94 If I compress with the noop compressor, the compressed data returned says that it has no data (but it does have the correct dtype, ndim, and number of elements). Am I doing something wrong? I do need to verify that the output has data to ensure that we're not reading out uninitialised data (UB in Rust), right? |
|
The noop compressor simply copies the input to the output. If the input has not data (e.g. pressio_data_new_empty) then the decompressed data will not either. |
|
The input does have data in my local test, and debug printing the compressed data before and after compression shows that the other metadata (dtype, dims, length) are filled in - yet the has_data call still returns false afterwards |
|
Can you please share a link to the test code, and I'll take a look (likely next week). |
|
@robertu94 Ok, I indentified the issue. While the noop compressor clones the data on compression, it copies into the decompressed data on decompression. Since I was passing in an array with no data for the decompressed output, it copied out no data, and still saw the array as empty. Fun fact - the noop compressor is unsound (in the Rust world)! I can give it a compressed array with 5xi64 values and an empty decompressed array with shape 10xi64, and it will read 10 values from the compressed array, i.e. 5 uninitialised data values. Is this behaviour intended? Rust cannot expose any safe code that would expose uninitialised memory, so no compressor should do this. |
|
You're right, that's a bug. What compressors are supposed to do in the decompression case is 1) if the What probably needs to happen in this case is a new function be added to the |
|
Ok, now let's try to match https://github.com/robertu94/libpressio/blob/master/tools/swig/libpressio.py as much as possible ... |
Uh oh!
There was an error while loading. Please reload this page.