From 3e3faf2fc32dbadc96a45f51f4361eb64ce6ed32 Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Fri, 20 Nov 2026 00:04:57 -0500 Subject: [PATCH] fix(kuna): use one constant for the serial job count (#12735) Release-As: 6.10.1 --- scripts/verify/rea-numeric-limits.mjs | 4 ++-- src/kuna/KunaConfiguration.ts | 16 +++++----------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/scripts/verify/rea-numeric-limits.mjs b/scripts/verify/rea-numeric-limits.mjs index 02a18358a3..95897bed6d 100644 --- a/scripts/verify/rea-numeric-limits.mjs +++ b/scripts/verify/rea-numeric-limits.mjs @@ -1210,8 +1210,8 @@ const restartOnlyBounds = (owners) => { ), bound( "REA_KUNA_JOBS", - exportedNumber(owners.kuna, "DEFAULT_KUNA_JOBS"), - exportedNumber(owners.kuna, "MINIMUM_KUNA_JOBS"), + exportedNumber(owners.kuna, "SERIAL_KUNA_JOBS"), + exportedNumber(owners.kuna, "SERIAL_KUNA_JOBS"), exportedNumber(owners.kuna, "MAXIMUM_KUNA_JOBS"), ), phaseBound(phases.doctor), diff --git a/src/kuna/KunaConfiguration.ts b/src/kuna/KunaConfiguration.ts index a396e316da..0c41df6a68 100644 --- a/src/kuna/KunaConfiguration.ts +++ b/src/kuna/KunaConfiguration.ts @@ -19,15 +19,13 @@ import { /** Kuna caps its own decode lanes and worker pool at 32. */ export const MAXIMUM_KUNA_JOBS = 32; -/** One job is the serial reference export. Zero is not a pool. */ -export const MINIMUM_KUNA_JOBS = 1; - /** * A serial (`--jobs 1`) export is Kuna's reference answer: it decompiles * callees before callers, which recovers prototypes that parallel workers * cannot. Measured on coreutils sort, 40-60% of functions differ otherwise. + * The serial export is the default and the minimum supported job count. */ -export const DEFAULT_KUNA_JOBS = MINIMUM_KUNA_JOBS; +export const SERIAL_KUNA_JOBS = 1; /** Measured sqlite3 exports occupy ~25 MiB; four GiB retains many projects. */ export const DEFAULT_KUNA_CACHE_MAX_BYTES = 4 * 1024 ** 3; @@ -251,15 +249,11 @@ export const readKunaConfiguration = ( const rawJobs = environment.REA_KUNA_JOBS; const jobs = - rawJobs === undefined ? DEFAULT_KUNA_JOBS : positiveInteger(rawJobs); - if ( - jobs === undefined || - jobs < MINIMUM_KUNA_JOBS || - jobs > MAXIMUM_KUNA_JOBS - ) + rawJobs === undefined ? SERIAL_KUNA_JOBS : positiveInteger(rawJobs); + if (jobs === undefined || jobs < SERIAL_KUNA_JOBS || jobs > MAXIMUM_KUNA_JOBS) return failure( "open_options_invalid", - `REA_KUNA_JOBS must be an integer from ${String(MINIMUM_KUNA_JOBS)} to ${String(MAXIMUM_KUNA_JOBS)}; received ${String(rawJobs)}.`, + `REA_KUNA_JOBS must be an integer from ${String(SERIAL_KUNA_JOBS)} to ${String(MAXIMUM_KUNA_JOBS)}; received ${String(rawJobs)}.`, "REA_KUNA_JOBS", );