Licence under MIT, and name what this was built from
MIT rather than a dual with BSD-3. Dual licensing solves a compatibility problem this does not have, since both are permissive and compatible with everything, so the choice would cost a downstream reader a decision and buy them nothing. The debt to zstd is real and a licence is the wrong instrument for it. No code came from libzstd; the format came from RFC 8878 and every answer is checked against libzstd through pyzstd. That belongs in prose where people read it. Also drops the line calling this a feasibility spike. It has 103 tests, an audit against the RFC, and five defects found and closed.
This commit is contained in:
parent
ca57654bab
commit
7bdad488ee
2 changed files with 55 additions and 4 deletions
21
LICENSE
Normal file
21
LICENSE
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2026 Tag Spilman
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
38
README.md
38
README.md
|
|
@ -7,9 +7,9 @@ an app that reads block-compressed elevation tiles on a phone would rather not
|
||||||
carry a native library per platform to do it. Decompression only. There is no
|
carry a native library per platform to do it. Decompression only. There is no
|
||||||
compressor and there is no plan for one.
|
compressor and there is no plan for one.
|
||||||
|
|
||||||
This is a feasibility spike, not a finished library. It decodes the real data
|
It decodes the real data it was written for, correctly and completely, and it
|
||||||
it was written for, correctly and completely, and it is roughly four times
|
is roughly four times slower than native zstd. See **Speed** below before
|
||||||
slower than native zstd. See **Speed** below before depending on it.
|
depending on it.
|
||||||
|
|
||||||
## Using it
|
## Using it
|
||||||
|
|
||||||
|
|
@ -142,7 +142,37 @@ Run it yourself:
|
||||||
|
|
||||||
## Licence
|
## Licence
|
||||||
|
|
||||||
Not chosen yet.
|
MIT. See [LICENSE](LICENSE).
|
||||||
|
|
||||||
|
## Acknowledgements
|
||||||
|
|
||||||
|
This is an independent implementation. It contains no code from libzstd, and
|
||||||
|
nothing about its licence reaches this package. It would not exist without the
|
||||||
|
following, and they are named here because that is where the debt actually is.
|
||||||
|
|
||||||
|
**[RFC 8878](https://www.rfc-editor.org/rfc/rfc8878.html), "Zstandard
|
||||||
|
Compression and the application/zstd Media Type"**, by Yann Collet and Murray
|
||||||
|
Kucherawy, is the specification this was written from. Every table in
|
||||||
|
`lib/src/tables.dart` was checked against section 3.1.1.3.2 entry by entry, and
|
||||||
|
the FSE and Huffman decoders follow the reference algorithms it describes. A
|
||||||
|
format specification written clearly enough to implement from is a gift, and
|
||||||
|
this one is.
|
||||||
|
|
||||||
|
**[Zstandard](https://github.com/facebook/zstd)**, by Yann Collet and
|
||||||
|
contributors at Meta, is the format and the reference implementation. Its
|
||||||
|
licence is BSD-3-Clause, and it obliges nothing here; it is named because
|
||||||
|
without it there would be nothing to decode.
|
||||||
|
|
||||||
|
**[pyzstd](https://pypi.org/project/pyzstd/)** wraps libzstd and is the oracle
|
||||||
|
every test in this package is measured against. Correctness here means
|
||||||
|
"agrees with libzstd, byte for byte", and pyzstd is how that is asked. The
|
||||||
|
committed fixtures under `test/fixtures/corpus/` are output of the `zstd` CLI
|
||||||
|
and of pyzstd, which is tool output rather than anything derived from their
|
||||||
|
source.
|
||||||
|
|
||||||
|
**The Dart team**, for making `int` an exact 64-bit integer on the VM and on
|
||||||
|
AOT. The bit reader carries 56 bits in one and XXH64's multiplies wrap exactly,
|
||||||
|
neither of which would be true on a platform with doubles underneath.
|
||||||
|
|
||||||
## Measured on the target device, 2026-09-21
|
## Measured on the target device, 2026-09-21
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue