From 7b07540a69460887bc0ee13b62c751f166fb2cd9 Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Fri, 26 Jun 2026 15:02:23 +0200 Subject: [PATCH] ci: update registry auth and improve adaptive worker scaling Refactor the release workflow to use a structured container object with authenticated pulls for macOS ARM64 builds. Replace single-worker activation with dynamic upfront provisioning based on node and worker counts. Implement an absolute efficiency gain threshold for scaling checks and add early termination to improve adaptive scaling stability. Bump obikmer crate version to 1.1.27. --- .gitea/workflows/release.yml | 6 +++++- src/Cargo.lock | 2 +- src/obikindex/src/numa.rs | 17 +++++++++-------- src/obikmer/Cargo.toml | 2 +- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index df9362f..810a12e 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -86,7 +86,11 @@ jobs: build-macos-arm64: needs: create-release runs-on: ubuntu-latest - container: registry.metabarcoding.org/cibuilder/rustcrossosx:latest + container: + image: registry.metabarcoding.org/cibuilder/rustcrossosx:latest + credentials: + username: ${{ github.actor }} + password: ${{ secrets.REGISTRYTOKEN }} defaults: run: working-directory: src diff --git a/src/Cargo.lock b/src/Cargo.lock index 5cbe11b..02603ed 100644 --- a/src/Cargo.lock +++ b/src/Cargo.lock @@ -1704,7 +1704,7 @@ dependencies = [ [[package]] name = "obikmer" -version = "1.1.26" +version = "1.1.27" dependencies = [ "clap", "csv", diff --git a/src/obikindex/src/numa.rs b/src/obikindex/src/numa.rs index 42eb48b..d5c368f 100644 --- a/src/obikindex/src/numa.rs +++ b/src/obikindex/src/numa.rs @@ -287,8 +287,9 @@ impl PartitionRunner { drop(event_tx); // ── Controller ──────────────────────────────────────────────────── - activate_tx.send(()).ok(); - let mut n_active = 1usize; + let initial_workers = n_nodes.min(max_workers).min(n_total); + for _ in 0..initial_workers { activate_tx.send(()).ok(); } + let mut n_active = initial_workers; let mut cpu_sample = CpuSample::now(); let mut eff_at_last_spawn = 0.0f64; // 0 = no previous spawn to evaluate let mut completed = 0usize; @@ -361,13 +362,13 @@ fn maybe_activate( // Going from k-1 → k workers, the minimum acceptable speedup is (k-1+0.2)/(k-1). // For the very first extra worker (n_active == 1, no previous spawn), skip this // check: eff_at_last_spawn == 0 acts as the sentinel. - let last_spawn_was_beneficial = if *eff_at_last_spawn < 1e-9 { - true // first additional worker: no prior data to evaluate + let last_spawn_was_beneficial = if *eff_at_last_spawn < 1e-9 || eff < 1e-9 { + true // first additional worker, or measurement too short: no prior data to evaluate } else { - let k_before = (*n_active - 1) as f64; - let min_speedup = (k_before + 0.2) / k_before; - let actual_speedup = eff / *eff_at_last_spawn; - actual_speedup >= min_speedup + let k_new = *n_active as f64; // worker count after the last spawn + let min_gain = 0.2 / k_new; + let actual_gain = (eff - *eff_at_last_spawn) / eff; + actual_gain >= min_gain }; if last_spawn_was_beneficial { diff --git a/src/obikmer/Cargo.toml b/src/obikmer/Cargo.toml index 4521ec4..6658b67 100644 --- a/src/obikmer/Cargo.toml +++ b/src/obikmer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "obikmer" -version = "1.1.26" +version = "1.1.27" edition = "2024" [[bin]] -- 2.52.0