-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* xxxx * fix/ci: adjust CI uris * chore: fmt * x * 8x * criterion * alignment * more identical checks * criterion fixes * fix padding zero calc * update concourse yml * enable privileged * test: add foundation tests for identical results for faster8 methods * add higher level tests and a few lines of documentation * make it work for constant input * x * fix * Revert "x" This reverts commit 0693a3c. * moar tests, fix borked `fn mul` * fix addition in avx2 * madness * more fuzz targets and regressions * format + remove dbg! statements * fix clipping * speedup walsh * x * remvoe dbg * remove more dbg! statements * fix compile * clippy * fix the last remaining bug, let's fuzz * fuzz it really * missing file * add concourse * more ci * refactor concourse.yml * hongg * hongg * hongg * move to hongg * bumpy * ci * hongg 0.5.61 * ci fixins * fix feature * minor * relative dep * Revert "relative dep" This reverts commit dfd565f. * Revert "minor" This reverts commit 2f67d33. * just inline * faster eq * correction + simplify * chore; add single pager, make a few things private * adhoc conversion * full criterion * fix/ci: adjust criterion run timeout for PR * ignore if target_feature not present * gating, fixed * f256 dummy 8x (unused, experimental impl anyways) * chore * fmt * mac os x CI failure * cfg(target_feature) * fix * chore: fmt * lock
- Loading branch information
Showing
33 changed files
with
2,901 additions
and
544 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#![allow(dead_code)] | ||
#![allow(unused_imports)] | ||
|
||
use hongg::fuzz; | ||
|
||
use novelpoly::f2e16::*; | ||
|
||
use arbitrary::*; | ||
|
||
#[derive(Debug, Clone)] | ||
struct FieldMpyParams { | ||
additive: Additive, | ||
mpy: Multiplier, | ||
idx_to_test: usize, | ||
} | ||
|
||
#[cfg(target_feature = "avx")] | ||
impl<'a> Arbitrary<'a> for FieldMpyParams { | ||
fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result<Self> { | ||
let additive = Additive(u.int_in_range(0..=u16::MAX)?); | ||
let mpy = Multiplier(u.int_in_range(0..=u16::MAX)?); | ||
let idx_to_test = u.choose_index(Additive8x::LANE)?; | ||
|
||
Ok(Self { additive, mpy, idx_to_test }) | ||
} | ||
} | ||
|
||
fn main() { | ||
#[cfg(target_feature = "avx")] | ||
run(); | ||
|
||
#[cfg(not(target_feature = "avx"))] | ||
panic!("Nothing to do for non avx enabled targets") | ||
} | ||
|
||
#[cfg(target_feature = "avx")] | ||
fn run() { | ||
// You have full control over the loop but | ||
// you're supposed to call `fuzz` ad vitam aeternam | ||
loop { | ||
// The fuzz macro gives an arbitrary object (see `arbitrary crate`) | ||
// to a closure-like block of code. | ||
// For performance reasons, it is recommended that you use the native type | ||
// `&[u8]` when possible. | ||
// Here, this slice will contain a "random" quantity of "random" data. | ||
fuzz!(|params: FieldMpyParams| { | ||
let FieldMpyParams { idx_to_test, additive, mpy } = params; | ||
let values = [additive; 8]; | ||
let values8x = Additive8x::from(values); | ||
let res_faster8 = values8x.mul(mpy); | ||
let res_plain = values[idx_to_test].mul(mpy); | ||
assert_eq!(res_plain, Additive8x::unpack(&res_faster8)[idx_to_test]); | ||
}); | ||
} | ||
} |
Oops, something went wrong.