-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connecting test harness #1
Comments
Thanks! I replaced the VecDeque with a classical Vec because it's faster. I adapted the rest of the code to use the it instead of the VecDeque but probably something goes wrong. I'll try to revert it and search any other issues. |
Got it working! See my PR here: #2 I'm sure some of the code is not idiomatic Rust -- sorry about that. But the test suite passes using all language combinations: Rust/C++, C++/Rust, Rust/JS, etc. I confirmed the wire output of the Rust version is identical to the C++. You might be able to convert |
… test suite, fix issues found by test suite
Thanks for the fix! Days ago I added a unit test that check if the output of the reconciliation was the same that I received from C++ (and effectively it was the same), but using the harness test you found an issue... https://github.com/yukibtc/rust-negentropy/blob/master/negentropy/src/lib.rs#L767 |
The code seems fast as before also with the |
Glad to hear! I agree it would be good to incorporate the reference test suite into the rust library, but it's quite a lot of extra stuff that would need to get pulled into your repo. And you'd need to compile the C++ code too. Maybe there is some more minimal integration we can do, I will think about that. |
Hi! I got the harness working. Unfortunately the test suite isn't passing yet. I'm trying to track it down. Here's my work so far: master...hoytech:rust-negentropy:harness
I added the harness and started comparing the behaviour of the C++ versus the Rust impl. The first thing that was causing me problems was that you used a vector for pending_output, but I used a deque. I just made the Rust one use a deque instead, so I can compare more directly for now. We can roll that back later if not necessary.
The first difference I noticed was in the
splitRange
function. The C++ function has an iteratorcurr
whereas the rust one doesn't. I added some tracing lines (visible in the above commit) and this is the output I get from rust:But this is what I got from the C++:
So something isn't advancing through the ranges properly in the rust version. You can reproduce this by checking out the two repos side-by-side (make sure to pull latest master in negentropy repo) and running the following command inside the
negentropy/test/
directory:The text was updated successfully, but these errors were encountered: