Skip to content
This repository has been archived by the owner on Oct 17, 2022. It is now read-only.

confirm licensing #1

Open
Licenser opened this issue Jan 29, 2020 · 4 comments
Open

confirm licensing #1

Licenser opened this issue Jan 29, 2020 · 4 comments

Comments

@Licenser
Copy link
Member

Hey @zwegner, I ported your code to rust and included a LICENSE-UPSTREAM with your original license. I'm always a bit unsure of how to handle licensing with ports so I figure it's simplest to ask if you're fine with that :).

@zwegner
Copy link

zwegner commented Jan 30, 2020

I guess my only concern would be whether I would still have partial copyright on the end result. It's a bit of a tricky subject here, where the code is somewhere between a mechanical translation and a clean-slate reimplementation of the algorithm. IANAL, but I think here, where there's still a good amount of my original text left (mainly comments), I would still have partial copyright. In that case, no need to add a separate upstream license file.

Dual licensing MIT/Apache should be fine. I'm not aware of all the ramifications, but I mostly just wanted attribution in code that use my library.

On a side note, I will note that there's an out-of-bounds memory access bug in my master branch code that is replicated here (it's fixed in my wip branch, but not rebased+cleaned up). In the main loop, the condition is while offset + V_LEN < len, but the unaligned load of shifted_bytes is from the pointer offset + V_LEN - 1, which accesses bytes up to address offset + 2*V_LEN - 2. It's not quite trivial to fix this, since you need to do one of these:

  • have two vector's worth of validation in the remainder code after the loop
  • load shifted_bytes from offset - 1 before each validation, and have special handling for the first loop iteration
  • use an instruction like vpalignr instead of any unaligned loads (this is generally slower in my testing)

@zwegner
Copy link

zwegner commented Jan 30, 2020

Oh, and also: thanks for doing this! faster-utf8-validator is one of the first projects I'd "advertised" in a long time, and it's really nice to see it getting some traction.

@Licenser
Copy link
Member Author

Thanks for the feedback. To be honest, I was less worried about the legal part as the 'doing the right thing' part :) and it seems we got the same approach there. I'll make sure the app calls out your work appropriately!

It is really nice work! :D I liked the code, it's clean well explained and pleasantly structured.

@zwegner
Copy link

zwegner commented Jan 30, 2020

It is really nice work! :D I liked the code, it's clean well explained and pleasantly structured.

Thanks! It's definitely gotten worse throughout the wip branch, and my choice of C over C++ is looking less wise in retrospect... I'll let you know when I finish documenting the algorithm changes there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants