Skip to content

Commit

Permalink
Merge pull request #28 from SoftVarE-Group/crane
Browse files Browse the repository at this point in the history
Use crane
  • Loading branch information
uulm-janbaudisch authored Jun 26, 2024
2 parents d75ae0e + 59697e5 commit af88aae
Show file tree
Hide file tree
Showing 18 changed files with 324 additions and 468 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,15 @@ jobs:
- double: aarch64-darwin
runner: macos-latest
variant:
- flake: all
- flake: ddnnife
artifact: ''
- flake: all-d4
- flake: bundled-d4
artifact: '-d4'
exclude:
- target: { double: x86_64-linux, runner: ubuntu-latest }
variant: { flake: all, artifact: '' }
include:
- target: { double: x86_64-linux, runner: ubuntu-latest }
variant: { flake: ddnnife-static, artifact: '' }
- target: { double: x86_64-windows, runner: ubuntu-latest }
variant: { flake: ddnnife-windows, artifact: '' }
- target: { double: x86_64-windows, runner: ubuntu-latest }
variant: { flake: bundled-d4-windows, artifact: '-d4' }
runs-on: ${{ matrix.target.runner }}
steps:
- name: Checkout
Expand All @@ -49,7 +48,7 @@ jobs:
- name: Build
run: nix build -L .#${{ matrix.variant.flake }}
- name: Set interpreter
if: ${{ matrix.target.double == 'x86_64-linux' && matrix.variant.artifact == '-d4' }}
if: ${{ matrix.target.double == 'x86_64-linux' && matrix.variant.flake == 'bundled-d4' }}
run: |
cp -rL result output
rm -rf result
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Portable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Cache
uses: DeterminateSystems/magic-nix-cache-action@v4
- name: Bundle
run: nix bundle --bundler github:DavHau/nix-portable -o bundle .#all-d4
run: nix bundle --bundler github:DavHau/nix-portable -o bundle .#ddnnife-d4
- name: Upload
uses: actions/upload-artifact@v4
with:
Expand Down
106 changes: 0 additions & 106 deletions .github/workflows/Windows.yaml

This file was deleted.

43 changes: 16 additions & 27 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ddnnife/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ tempfile = "3.10"
workctl = "0.2"

[target.'cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))'.dependencies]
d4-oxide = { version = "0.3.0", optional = true }
d4-oxide = { version = "0.4", optional = true }

[dev-dependencies]
assert_cmd = "2.0"
Expand Down
44 changes: 19 additions & 25 deletions ddnnife/src/ddnnf/anomalies/config_creation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,11 +492,7 @@ mod test {
}

let auto1_samples = auto1
.uniform_random_sampling(
&mut [-546, 55, 646, -872, -873, 102, 23, 764, -1111],
1_000,
42,
)
.uniform_random_sampling(&[-546, 55, 646, -872, -873, 102, 23, 764, -1111], 1_000, 42)
.unwrap();
for sample in auto1_samples {
assert!(auto1.sat(&sample));
Expand All @@ -511,37 +507,37 @@ mod test {

// same seeding should yield same results, different seeding should (normally) yield different results
assert_eq!(
vp9.uniform_random_sampling(&mut [], 100, 42),
vp9.uniform_random_sampling(&mut [], 100, 42)
vp9.uniform_random_sampling(&[], 100, 42),
vp9.uniform_random_sampling(&[], 100, 42)
);
assert_eq!(
vp9.uniform_random_sampling(&mut [23, 4, -17], 100, 99),
vp9.uniform_random_sampling(&mut [23, 4, -17], 100, 99),
vp9.uniform_random_sampling(&[23, 4, -17], 100, 99),
vp9.uniform_random_sampling(&[23, 4, -17], 100, 99),
);
assert_ne!(
vp9.uniform_random_sampling(&mut [38, 2, -14], 100, 99),
vp9.uniform_random_sampling(&mut [38, 2, -14], 100, 50),
vp9.uniform_random_sampling(&[38, 2, -14], 100, 99),
vp9.uniform_random_sampling(&[38, 2, -14], 100, 50),
);

assert_eq!(
auto1.uniform_random_sampling(&mut [], 100, 42),
auto1.uniform_random_sampling(&mut [], 100, 42)
auto1.uniform_random_sampling(&[], 100, 42),
auto1.uniform_random_sampling(&[], 100, 42)
);
assert_eq!(
auto1.uniform_random_sampling(
&mut [-546, 55, 646, -872, -873, 102, 23, 764, -1111],
&[-546, 55, 646, -872, -873, 102, 23, 764, -1111],
100,
1970
),
auto1.uniform_random_sampling(
&mut [-546, 55, 646, -872, -873, 102, 23, 764, -1111],
&[-546, 55, 646, -872, -873, 102, 23, 764, -1111],
100,
1970
),
);
assert_ne!(
auto1.uniform_random_sampling(&mut [11, 12, 13, -14, -15, -16], 100, 1),
auto1.uniform_random_sampling(&mut [11, 12, 13, -14, -15, -16], 100, 2)
auto1.uniform_random_sampling(&[11, 12, 13, -14, -15, -16], 100, 1),
auto1.uniform_random_sampling(&[11, 12, 13, -14, -15, -16], 100, 2)
);
}

Expand All @@ -550,18 +546,16 @@ mod test {
let mut vp9: Ddnnf = build_ddnnf("tests/data/VP9_d4.nnf", Some(42));
let mut auto1: Ddnnf = build_ddnnf("tests/data/auto1_d4.nnf", Some(2513));

assert!(vp9.uniform_random_sampling(&mut [1, -1], 1, 42).is_none());
assert!(vp9.uniform_random_sampling(&[1, -1], 1, 42).is_none());
assert!(vp9
.uniform_random_sampling(&mut [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 1, 42)
.uniform_random_sampling(&[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 1, 42)
.is_none());
assert!(vp9.uniform_random_sampling(&mut [100], 1, 42).is_none());
assert!(vp9.uniform_random_sampling(&[100], 1, 42).is_none());

assert!(auto1.uniform_random_sampling(&mut [1, -1], 1, 42).is_none());
assert!(auto1.uniform_random_sampling(&[1, -1], 1, 42).is_none());
assert!(auto1
.uniform_random_sampling(&mut [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 1, 42)
.is_none());
assert!(auto1
.uniform_random_sampling(&mut [-10_000], 1, 42)
.uniform_random_sampling(&[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 1, 42)
.is_none());
assert!(auto1.uniform_random_sampling(&[-10_000], 1, 42).is_none());
}
}
2 changes: 1 addition & 1 deletion ddnnife/tests/write_to_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fn card_of_features_normal_and_reloaded_test() {

// save nnf in c2d format
let saved_nnf = "./tests/data/auto1_d4_to_c2d.nnf";
write_ddnnf_to_file(&mut ddnnf, saved_nnf).unwrap();
write_ddnnf_to_file(&ddnnf, saved_nnf).unwrap();

// compute the cardinality of features for the saved file
let saved_out = "./tests/data/auto1_d4_to_c2d_fs.csv";
Expand Down
8 changes: 8 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[licenses]
allow = [
"LGPL-3.0",
"MIT",
"BSD-3-Clause",
"BSL-1.0",
"Unicode-DFS-2016",
]
1 change: 0 additions & 1 deletion doc/aarch64-darwin-d4.md

This file was deleted.

1 change: 0 additions & 1 deletion doc/windows-d4.md

This file was deleted.

Loading

0 comments on commit af88aae

Please sign in to comment.