Skip to content

Commit a44a2c7

Browse files
chore: move from random testing to testing only the first N intrinsics
1 parent fcaf610 commit a44a2c7

File tree

3 files changed

+9
-79
lines changed

3 files changed

+9
-79
lines changed

library/stdarch/Cargo.lock

Lines changed: 7 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -282,18 +282,6 @@ dependencies = [
282282
"wasi",
283283
]
284284

285-
[[package]]
286-
name = "getrandom"
287-
version = "0.3.4"
288-
source = "registry+https://github.com/rust-lang/crates.io-index"
289-
checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd"
290-
dependencies = [
291-
"cfg-if",
292-
"libc",
293-
"r-efi",
294-
"wasip2",
295-
]
296-
297285
[[package]]
298286
name = "hashbrown"
299287
version = "0.12.3"
@@ -360,7 +348,6 @@ dependencies = [
360348
"log",
361349
"pretty_env_logger",
362350
"quick-xml 0.37.5",
363-
"rand 0.9.2",
364351
"rayon",
365352
"regex",
366353
"serde",
@@ -486,7 +473,7 @@ checksum = "588f6378e4dd99458b60ec275b4477add41ce4fa9f64dcba6f15adccb19b50d6"
486473
dependencies = [
487474
"env_logger 0.8.4",
488475
"log",
489-
"rand 0.8.5",
476+
"rand",
490477
]
491478

492479
[[package]]
@@ -498,31 +485,15 @@ dependencies = [
498485
"proc-macro2",
499486
]
500487

501-
[[package]]
502-
name = "r-efi"
503-
version = "5.3.0"
504-
source = "registry+https://github.com/rust-lang/crates.io-index"
505-
checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
506-
507488
[[package]]
508489
name = "rand"
509490
version = "0.8.5"
510491
source = "registry+https://github.com/rust-lang/crates.io-index"
511492
checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
512493
dependencies = [
513494
"libc",
514-
"rand_chacha 0.3.1",
515-
"rand_core 0.6.4",
516-
]
517-
518-
[[package]]
519-
name = "rand"
520-
version = "0.9.2"
521-
source = "registry+https://github.com/rust-lang/crates.io-index"
522-
checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
523-
dependencies = [
524-
"rand_chacha 0.9.0",
525-
"rand_core 0.9.3",
495+
"rand_chacha",
496+
"rand_core",
526497
]
527498

528499
[[package]]
@@ -532,17 +503,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
532503
checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
533504
dependencies = [
534505
"ppv-lite86",
535-
"rand_core 0.6.4",
536-
]
537-
538-
[[package]]
539-
name = "rand_chacha"
540-
version = "0.9.0"
541-
source = "registry+https://github.com/rust-lang/crates.io-index"
542-
checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
543-
dependencies = [
544-
"ppv-lite86",
545-
"rand_core 0.9.3",
506+
"rand_core",
546507
]
547508

548509
[[package]]
@@ -551,16 +512,7 @@ version = "0.6.4"
551512
source = "registry+https://github.com/rust-lang/crates.io-index"
552513
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
553514
dependencies = [
554-
"getrandom 0.2.16",
555-
]
556-
557-
[[package]]
558-
name = "rand_core"
559-
version = "0.9.3"
560-
source = "registry+https://github.com/rust-lang/crates.io-index"
561-
checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38"
562-
dependencies = [
563-
"getrandom 0.3.4",
515+
"getrandom",
564516
]
565517

566518
[[package]]
@@ -751,7 +703,7 @@ dependencies = [
751703
name = "stdarch-gen-loongarch"
752704
version = "0.1.0"
753705
dependencies = [
754-
"rand 0.8.5",
706+
"rand",
755707
]
756708

757709
[[package]]
@@ -784,7 +736,7 @@ version = "0.0.0"
784736
dependencies = [
785737
"core_arch",
786738
"quickcheck",
787-
"rand 0.8.5",
739+
"rand",
788740
]
789741

790742
[[package]]
@@ -867,15 +819,6 @@ version = "0.11.1+wasi-snapshot-preview1"
867819
source = "registry+https://github.com/rust-lang/crates.io-index"
868820
checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
869821

870-
[[package]]
871-
name = "wasip2"
872-
version = "1.0.1+wasi-0.2.4"
873-
source = "registry+https://github.com/rust-lang/crates.io-index"
874-
checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7"
875-
dependencies = [
876-
"wit-bindgen",
877-
]
878-
879822
[[package]]
880823
name = "wasmparser"
881824
version = "0.235.0"
@@ -1060,12 +1003,6 @@ version = "0.53.0"
10601003
source = "registry+https://github.com/rust-lang/crates.io-index"
10611004
checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486"
10621005

1063-
[[package]]
1064-
name = "wit-bindgen"
1065-
version = "0.46.0"
1066-
source = "registry+https://github.com/rust-lang/crates.io-index"
1067-
checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59"
1068-
10691006
[[package]]
10701007
name = "xml-rs"
10711008
version = "0.8.27"

library/stdarch/crates/intrinsic-test/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,3 @@ itertools = "0.14.0"
2222
quick-xml = { version = "0.37.5", features = ["serialize", "overlapped-lists"] }
2323
serde-xml-rs = "0.8.0"
2424
regex = "1.11.1"
25-
rand = "0.9.2"

library/stdarch/crates/intrinsic-test/src/x86/mod.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ use crate::common::intrinsic::Intrinsic;
1212
use crate::common::intrinsic_helpers::TypeKind;
1313
use intrinsic::X86IntrinsicType;
1414
use itertools::Itertools;
15-
use rand::rng;
16-
use rand::seq::IndexedRandom;
1715
use xml_parser::get_xml_intrinsics;
1816

1917
pub struct X86ArchitectureTest {
@@ -49,10 +47,9 @@ impl SupportedArchitectureTest for X86ArchitectureTest {
4947
let intrinsics =
5048
get_xml_intrinsics(&cli_options.filename).expect("Error parsing input file");
5149

52-
let mut rng = rng();
5350
let sample_percentage: usize = cli_options.sample_percentage as usize;
5451

55-
let intrinsics = intrinsics
52+
let mut intrinsics = intrinsics
5653
.into_iter()
5754
// Not sure how we would compare intrinsic that returns void.
5855
.filter(|i| i.results.kind() != TypeKind::Void)
@@ -68,10 +65,7 @@ impl SupportedArchitectureTest for X86ArchitectureTest {
6865
.collect::<Vec<_>>();
6966

7067
let sample_size = (intrinsics.len() * sample_percentage) / 100;
71-
let mut intrinsics = intrinsics
72-
.choose_multiple(&mut rng, sample_size)
73-
.cloned()
74-
.collect::<Vec<_>>();
68+
intrinsics.truncate(sample_size);
7569

7670
intrinsics.sort_by(|a, b| a.name.cmp(&b.name));
7771
Self {

0 commit comments

Comments
 (0)