Commit Graph
72 Commits
Author SHA1 Message Date
swaits 4ab1aaaea2 chore: finally add CHANGELOG.md
Should've added a CHANGELOG.md a long time ago and stuck with
Conventional Commits.

Used `git cliff` to generate a mostly-acceptable changelog.
2023-10-31 21:58:45 -06:00
swaits 23713e9e89 chore: update dependencies, update CI 2023-10-23 18:46:33 -06:00
swaits 423f439714 chore: allow lint which is failing in proptest (thank you CI) 2023-10-23 18:14:07 -06:00
swaits 0c1484c222 style: convert to nextest; README.md formatting 2023-10-23 18:06:12 -06:00
swaits 88da4a2452 chore: update dependencies 2023-10-20 22:57:35 -06:00
swaits f5b82c5cb3 docs: README update (contributing) 2023-09-29 11:44:11 -06:00
swaits b737e9b381 chore: update parameter to cargo tarpaulin (s/Html/html/) 2023-09-29 11:28:22 -06:00
swaits 8cfda8a912 chore: update MSRV (because serde), increase version 2023-09-29 11:17:57 -06:00
swaits 3a6a62a4ab chore: update dependencies, bump crate to 0.6.9 2023-09-22 16:06:13 -06:00
swaits 55fb764bb9 chore: bump crate version to 0.6.8 2023-05-15 11:12:34 -06:00
swaits effd941188 chore: bump deps to latest versions 2023-05-15 11:11:26 -06:00
swaits 80484ba9f0 chore: update deps, bump crate version 2023-04-20 14:21:24 -06:00
swaits 14002e1f0c docs: add MSRV icon and TOC to README.md 2023-03-30 10:03:15 -06:00
swaits 47f64bff8c chore: switch to sparse cargo registry; upgrade deps; bump crate version 2023-03-30 09:51:02 -06:00
swaits 18f07412a8 chore: update deps, bump crate to 0.6.5 2023-03-21 21:12:04 -06:00
swaits fcbc2cbc08 chore: bump crate to 0.6.4Signed-off-by: Stephen Waits <steve@waits.net> 2023-02-26 10:05:59 -07:00
swaits 0dedd8c6ba chore: upgrade dependencies
Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-26 10:05:33 -07:00
swaits 988436bf19 chore: add MSRV (1.60)
Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-26 09:54:23 -07:00
swaits cabee3c631 chore: bump crate to 0.6.3Signed-off-by: Stephen Waits <steve@waits.net> 2023-02-13 13:11:33 -07:00
swaits 37f5555323 test: make accepted licenses explicit
Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-13 12:50:36 -07:00
swaits 5f581fb089 test: fix cargo audit advisory db location
Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-13 12:45:43 -07:00
swaits f98f971e30 test: add audit, deny, outdated, and udeps to CI
Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-13 12:36:24 -07:00
swaits 0641f73ab3 test: add (and fix) more deny lints
Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-13 12:35:26 -07:00
swaits f3deb17832 style: move clippy allows to specific lines of code
Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-13 11:40:12 -07:00
swaits ba4107cd56 style: more Cargo.toml formatting 2023-02-13 11:13:33 -07:00
swaits e257e19dc2 style: format Cargo.toml 2023-02-13 11:10:44 -07:00
swaits f099f035b8 chore: bump crate to 0.6.2Signed-off-by: Stephen Waits <steve@waits.net> 2023-02-13 10:58:18 -07:00
swaits 6cc4e3cbbc fix(test): allow clippy lints on specific tests 2023-02-13 10:51:28 -07:00
swaits 79e5ed0d51 build: add husky for pre-commit hook generationSigned-off-by: Stephen Waits <steve@waits.net> 2023-02-13 10:48:19 -07:00
swaits 2809dbc280 refactor: clean up by using cfg-if where possible
Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-13 10:41:49 -07:00
swaits b70449a9c2 refactor: misc cleanup- move from std::ops to core::ops- remove unnecessary println! calls in testsSigned-off-by: Stephen Waits <steve@waits.net> 2023-02-13 09:52:35 -07:00
swaits f5ddbc0533 refactor: change unwrap()s to expects() and deny in clippy
Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-13 09:30:00 -07:00
swaits 1e1365ee13 refactor: change std::time::Duration to std::core::Duration
One step closer to `no_std`.

Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-13 09:29:12 -07:00
swaits 88c762a870 test: use prop_assert* macros where appropriate
The prop_assert* macros clean-up the assertion output by eliminating the extra panics while it’s reducing inputs.

Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-13 09:28:09 -07:00
swaits 66be2bf6c6 chore: bump crate to 0.6.1 2023-02-10 23:02:46 -05:00
swaits f5dc99f7d3 refactor: switch to array-init
- Use array-init for the lowest level vector operations. Makes them nicer and less bug-prone, with zero performance impact.
- Remove unnecessary/unused ::new() functions on Vector and HeightVector.
- Update README with new dependency.
- Fix typo in README.

Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-10 22:51:38 -05:00
swaits e20d9a284a chore: bump crate to 0.6.0 2023-02-10 12:38:11 -07:00
swaits 7a131c6c7c build: test sr.ht build manifest using package instead of cargo installSigned-off-by: Stephen Waits <steve@waits.net> 2023-02-10 12:31:57 -07:00
swaits 28097611a7 test: get to 100% coverage, clean up cargo features
- eliminated `f64` feature because Cargo doesn’t understand mutually exclusive features. So, we default to `f64`, and leave the `f32` feature there if people want to change to that.
- integrated tarpaulin for coverage
- added tests to get to 100% coverage
- fixed NetworkCoordinate Div impl safety checks (now acts like Add and Sub)
- update README to explain cargo feature change
- cleanup build script with the new simpler features model

Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-10 12:14:24 -07:00
swaits e95402ca62 test: add examples to CI
Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-09 20:25:51 -07:00
swaits 60dba8fb0f test: add more stuff to CI
Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-09 20:17:24 -07:00
swaits 95ce16ef0a chore: bump crate to 0.5.4Signed-off-by: Stephen Waits <steve@waits.net> 2023-02-09 16:39:02 -07:00
swaits 737f533f7e perf: add benchmark, optimize
Realized about a 10x speedup.

- add benches/million-updates.rs
- optimization: use rand instead of nanorand (because of thread_rng() initialization being muchf aster)
- update README

Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-09 16:36:24 -07:00
swaits 84a818b9b9 chore: bump crate to 0.5.3Signed-off-by: Stephen Waits <steve@waits.net> 2023-02-09 11:18:04 -07:00
swaits c192739a14 docs: updates to NetworkCoordinateSigned-off-by: Stephen Waits <steve@waits.net> 2023-02-09 11:17:27 -07:00
swaits 9101a3fc99 build: enable cargo fmt check in autobuildSigned-off-by: Stephen Waits <steve@waits.net> 2023-02-09 11:02:03 -07:00
swaits da6a70e08d build: enable and fix stricter clippy linting- add clippy to .build.yml to run on sr.ht- add missing docs- use core:: instead of std:: where possible- use hypot() and mul_add() for better numeric stability- make all float tests use asser_approx_eq() and explicitly check for NaN/Inf- add missing semicolons here and there- add #[must_use] to ensure caller uses returned value- add const fn where appropriate- change visibility from pub(crate) to pub (in private modules)Signed-off-by: Stephen Waits <steve@waits.net> 2023-02-09 10:54:42 -07:00
swaits 9d0a318248 feat: f32/f64 cargo features added
Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-08 17:01:19 -07:00
swaits 1bfdce1c21 docs: minor updates re: type aliases, crate to 0.5.1Signed-off-by: Stephen Waits <steve@waits.net> 2023-02-08 15:59:15 -07:00
swaits f0dedff879 docs: udpate crate description 2023-02-08 15:48:46 -07:00
swaits cb60d0a1c0 chore: bump crate to 0.5.0Signed-off-by: Stephen Waits <steve@waits.net> 2023-02-08 15:40:47 -07:00
swaits 0cbe57a317 feat: type aliases for 2D/3D NetworkCoordinates
This just adds a few type aliases for convenience, and slightly better ergonomics for the most common usage (2D or 3D).

Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-08 15:40:23 -07:00
swaits 02c99ae0de feat: improve ergonomics for serialization format
Goal: To make the serialization format more sensible instead of it being a reflection of our internal (ie private) data model.

- mostly handled with #[serde()] macros (renaming, flattening)
- renamed NetworkCoordinate::position to heightvec which is a better name, even if not seen in the published interface
- changed HeightVector from a tuple struct to a named struct so we can control serde on a field-by-field basis
- updated README, tests, and doc tests to match

Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-08 15:32:27 -07:00
swaits 3cb28947f6 fix: exclude examples from crate
crates.io is limited to 10MB crates

Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-07 22:09:28 -07:00
swaits 880d604d87 chore: bump crate versionSigned-off-by: Stephen Waits <steve@waits.net> 2023-02-07 21:44:47 -07:00
swaits 8f95ed8c9f test: add test for NetworkCoordinate::estimate_rtt
Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-07 21:43:35 -07:00
swaits 81ffc119e5 style: formattingSigned-off-by: Stephen Waits <steve@waits.net> 2023-02-07 21:37:29 -07:00
swaits e86e211bed test: add property tests to HeightVector
Which also helped me fix a bug (using is_sign_negative() when we actually are okay with -0.0).

Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-07 21:37:21 -07:00
swaits e9c91e1e11 feat: add PlanetLab example
Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-07 20:40:06 -07:00
swaits 26a7b243dc fix: add numeric stability
Made `HeightVector` numerically safe; while `Vector` remains numerically unsafe (i.e. it can divide by 0, NaN, Inf, etc).

When HeightVector runs into a problem, it just re-randomizes itself. Since the algorithm converges relatively quickly, this seems to work fine.

Also fixed a bug so that now height will always start as a positive number (and stay that way, else get re-randomized).

Added safety to `NetworkCoordinate` which now checks that its error didn’t pull a `HeightVector` into a negative height; in which case it also re-randomizes.

Clarified the `random` construction, tweaked the DEFAULT_ERROR constant, and updated tests accordingly.

Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-07 20:25:10 -07:00
swaits 441f83cc6f test: add proptest, make vec mul/div scalar safer
Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-07 16:29:01 -07:00
swaits 57dcb9dd7f docs: add link to ticket trackerSigned-off-by: Stephen Waits <steve@waits.net> 2023-02-04 10:48:28 -07:00
swaits 579035cd2d docs: add link to docs.rs in READMESigned-off-by: Stephen Waits <steve@waits.net> 2023-02-04 10:43:36 -07:00
swaits 308f94d0d1 chore: bump crate versionSigned-off-by: Stephen Waits <steve@waits.net> 2023-02-04 10:40:57 -07:00
swaits 3347e5fe0d docs: clean up export, add module level docs- public NetworkCoordinate so it’s easer to just use vivaldi_nc::NetworkCoordinate- add module level docs and examples in lib.rs- cleanup READMESigned-off-by: Stephen Waits <steve@waits.net> 2023-02-04 10:39:59 -07:00
swaits ebfee50ee6 chore: update README, bump crate versionSigned-off-by: Stephen Waits <steve@waits.net> 2023-02-04 09:48:01 -07:00
swaits b3147dfad7 feat: add serde
Adds serialization/deserialization support via serde and serde_with.

Also:

- remove `license-file` in Cargo.toml (superfluous)
- update README with Getting Started section
- add `serde` and `serde_with` dependencies to README
- add tests to `HeightVector`
- tweak assertion in `NetworkCoordinate`
- refactor `Vector` to be a struct witn an `inner` instead of a tuple struct so that we can use `serde_as` (from `serde_with`) to help us derive SerDe implementations for the const generic sized array
- moved trait requirements (which are getting long) into where clauses

Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-04 09:42:46 -07:00
swaits 9265b5fa28 chore: remove Cargo.lock and add to .gitignoreBecause this is a library, Cargo.lock should not be committed.Signed-off-by: Stephen Waits <steve@waits.net> 2023-02-04 09:37:40 -07:00
swaits dd063825f9 chore: prep Cargo.toml for publication, add badgesSigned-off-by: Stephen Waits <steve@waits.net> 2023-02-02 22:33:15 -07:00
swaits c2f2d874e4 chore: add build badge to readmeSigned-off-by: Stephen Waits <steve@waits.net> 2023-02-02 21:56:18 -07:00
swaits 280f50e9f7 chore: Add build script for git.sr.htSigned-off-by: Stephen Waits <steve@waits.net> 2023-02-02 21:48:35 -07:00
swaits f29deb5335 initial commit
Includes an initial implementation, some tests, and some documentation.

Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-02 21:19:09 -07:00