From 80a88fc429358dd012f1b411893f99a6bd04fb18 Mon Sep 17 00:00:00 2001 From: Alexander Clausen Date: Fri, 2 Feb 2024 13:24:03 +0100 Subject: [PATCH 1/3] Try to test on macos 14 (M1) --- .github/workflows/CI.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1d744c76..94fe7982 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -120,12 +120,13 @@ jobs: working-directory: ${{ matrix.crate }} macos-test: - runs-on: macos-latest env: MACOSX_DEPLOYMENT_TARGET: "11.0" strategy: matrix: crate: [libertem_dectris, libertem_asi_tpx3] + os: [macos-12, macos-14] + runs-on: ${{ matrix.os }} steps: - name: Set LIBCLANG_PATH run: echo "LIBCLANG_PATH=$(brew --prefix llvm@15)/lib" >> $env:GITHUB_ENV From 6de5dfa305a64031553313fb5c20c857b2b21f8c Mon Sep 17 00:00:00 2001 From: Alexander Clausen Date: Fri, 2 Feb 2024 14:17:27 +0100 Subject: [PATCH 2/3] WIP: update test to be independent of page size Probably needs further changes, but hard to check locally... --- libertem_asi_tpx3/Cargo.toml | 1 + libertem_asi_tpx3/src/chunk_stack.rs | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libertem_asi_tpx3/Cargo.toml b/libertem_asi_tpx3/Cargo.toml index 6bfa2225..72752241 100644 --- a/libertem_asi_tpx3/Cargo.toml +++ b/libertem_asi_tpx3/Cargo.toml @@ -25,6 +25,7 @@ uuid = { version = "1.1.2", features = ["v4", "fast-rng"] } ipc-test = { path = "../ipc_test" } stats = { path = "../stats" } zerocopy = "0.6.1" +page_size = "0.5.0" [dev-dependencies] tempfile = "3.3.0" diff --git a/libertem_asi_tpx3/src/chunk_stack.rs b/libertem_asi_tpx3/src/chunk_stack.rs index cfc4b05d..09296328 100644 --- a/libertem_asi_tpx3/src/chunk_stack.rs +++ b/libertem_asi_tpx3/src/chunk_stack.rs @@ -680,20 +680,20 @@ mod tests { #[test] fn test_can_fit() { let (_socket_dir, socket_as_path) = get_socket_path(); - // slot size is rounded up to 4k blocks - let mut shm = SharedSlabAllocator::new(3, 4096, false, &socket_as_path).unwrap(); + let slot_size = page_size::get(); + let mut shm = SharedSlabAllocator::new(3, slot_size, false, &socket_as_path).unwrap(); let slot = shm.get_mut().expect("get a free shm slot"); let mut fs = ChunkStackForWriting::new(slot, 1); - assert!(fs.can_fit(4096)); + assert!(fs.can_fit(slot_size)); assert!(fs.can_fit(1024)); assert!(fs.can_fit(512)); assert!(fs.can_fit(0)); assert!(fs.can_fit(1)); println!("{}", fs.total_size()); - assert!(!fs.can_fit(4097)); + assert!(!fs.can_fit(slot_size + 1)); const NNZ: u32 = 12; const NROWS: u32 = 7; From 1b71d5648db17d2730069c0e3f736d042b461a9c Mon Sep 17 00:00:00 2001 From: Alexander Clausen Date: Fri, 2 Feb 2024 14:29:41 +0100 Subject: [PATCH 3/3] WIP: try to make the test more independent of slot size --- libertem_asi_tpx3/src/chunk_stack.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libertem_asi_tpx3/src/chunk_stack.rs b/libertem_asi_tpx3/src/chunk_stack.rs index 09296328..134c2d6e 100644 --- a/libertem_asi_tpx3/src/chunk_stack.rs +++ b/libertem_asi_tpx3/src/chunk_stack.rs @@ -718,14 +718,15 @@ mod tests { assert_eq!(fs.padding_bytes, 7); assert_eq!(fs.cursor, 8); - assert!(!fs.can_fit(4096)); - assert!(fs.can_fit(4088)); + assert!(!fs.can_fit(slot_size)); + assert!(fs.can_fit(slot_size - 8)); - fs.slice_for_writing(4088, layout.clone()); + fs.slice_for_writing(slot_size - 8, layout.clone()); assert_eq!(fs.padding_bytes, 7); - assert_eq!(fs.cursor, 4096); + assert_eq!(fs.cursor, slot_size); assert!(!fs.can_fit(1)); assert!(!fs.can_fit(8)); assert!(!fs.can_fit(4096)); + assert!(!fs.can_fit(slot_size)); } }