Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
c1b4399
test(qa): a NaN single-objective value is logged as [nan] where Optun…
Nucs Nov 8, 2026
94de6f9
feat(examples): 0_ContainerLoadingStopAtBound - enqueue_trial(skip_if…
Nucs Nov 8, 2026
acd2162
feat(examples): 0_DistributedJournalHyperband - 3 processes x n_jobs=…
Nucs Nov 8, 2026
5101645
feat(examples): 0_ChurnScorecardTerminator - the Terminator's documen…
Nucs Nov 8, 2026
0d97a6a
feat(examples): 0_PricingRemoteWorkersGrpc - remote workers (C# and P…
Nucs Nov 8, 2026
b448b95
feat(examples): 0_BuildingEnergyForestSearchCV - OptunaSearchCV over …
Nucs Nov 8, 2026
9680873
feat(examples): 0_ConcreteMixDesignGp - GPSampler on a mixed stepped/…
Nucs Nov 8, 2026
5e5ba53
docs(plans): plan 13, Rustuna-derived performance: compatible speedup…
Nucs Nov 8, 2026
99e9e73
perf(cmaes): restore the optimizer once per generation and fold the h…
Nucs Nov 8, 2026
f8df1a5
perf(storage): write a running trial in place while no reader holds i…
Nucs Nov 8, 2026
4464e8a
perf(tpe): fused scoring kernel, one trial split per trial, zero-copy…
Nucs Nov 8, 2026
9043b43
perf(storage): CachedStorage reads its cache in number order and wrap…
Nucs Nov 8, 2026
ca9b9fe
docs(plan13): implementation record and before/after proof; Performan…
Nucs Nov 8, 2026
05edfdf
docs(tpe): name the overload in three crefs the span overloads of dce…
Nucs Nov 9, 2026
53a7a0f
feat(storage): write several attributes in one step (plan 13, item S8…
Nucs Nov 9, 2026
f0d62a0
feat(storage): opt-in compact finished trials in InMemoryStorage (pla…
Nucs Nov 9, 2026
f4eca0c
docs(plan13): name S12's commit (17716c7) in the status line and the …
Nucs Nov 9, 2026
adda96c
perf(samplers): stop leaving NumSharp arrays to the finalizer on per-…
Nucs Nov 9, 2026
db4e46c
perf(tpe): exact O(n) kernel widths, cached finished observations, no…
Nucs Nov 9, 2026
a279254
perf(qmc): compute the sample-id key once per search space (plan 14, …
Nucs Nov 9, 2026
45fadd1
perf(journal): keep sparse line offsets in the file backend (plan 14,…
Nucs Nov 9, 2026
2dc35cf
perf(sqlite): refresh running trials with UNION ALL instead of OR (pl…
Nucs Nov 9, 2026
14b4698
perf(tpe): take each categorical weight's log once per kernel and cho…
Nucs Nov 9, 2026
0c51499
docs(plan14): record plan 14 (Rustuna, second pass) with its gates an…
Nucs Nov 9, 2026
dfc026f
fix(tpe): the observation cache checks each row's trial, so a study r…
Nucs Nov 9, 2026
c5ca998
test(qa): parity QA run 2 starts — NSGA-III NaN niching order, batche…
Nucs Nov 10, 2026
ee52ef8
test(qa): SQLite variable-limit fallback and CMAwM ragged tell (QA-59…
Nucs Nov 10, 2026
b79e401
test(qa): CLI YAML loses value types, decimal scale limit reaches tin…
Nucs Nov 10, 2026
21376e8
test(qa): CLI `tell --state fail|pruned` without --values dies (QA-63…
Nucs Nov 10, 2026
548f89c
test(qa): CLI structured --sampler-kwargs rejected (QA-64); fixed CLI…
Nucs Nov 10, 2026
ac073f0
test(qa): CLI --log-file receives records Optuna's never does (QA-65,…
Nucs Nov 10, 2026
8ff6f4f
test(qa): QA-60 also fires on conditional search spaces (raised to ME…
Nucs Nov 10, 2026
9f3d3a9
docs(qa): parity QA run 2, eighth batch: pruner, fixed-value, API-seq…
Nucs Nov 10, 2026
618120d
test(qa): storage-level KeyError type and empty DuplicatedStudyError …
Nucs Nov 10, 2026
878071c
docs(qa): correct the run 2 progress-log timestamps written after 23:…
Nucs Nov 10, 2026
c5d79f9
docs(qa): QA-41 and QA-42 found fixed in passing (their OpenBugs test…
Nucs Nov 10, 2026
4cbdce7
docs(qa): QA-56 is frequent in long NSGA-III runs; net8.0 probe, cons…
Nucs Nov 10, 2026
52f6e95
docs(qa): mixed Python + C# fleets on one journal and one SQLite file…
Nucs Nov 10, 2026
7dca442
test(qa): studies listed out of creation order after a deletion on me…
Nucs Nov 10, 2026
613a9eb
test(qa): GridSampler's unvisited grids follow CPython set order, rea…
Nucs Nov 10, 2026
5698360
docs(qa): run 2 sweeps — best-trial ties, modulo and Misaligned premi…
Nucs Nov 10, 2026
0852cb2
docs(qa): categorical choices equal under Python == and CLI JSON-argu…
Nucs Nov 10, 2026
8624798
docs(qa): storage upgrade on Optuna's ten upgrade-test databases matc…
Nucs Nov 10, 2026
d133e63
docs(qa): QA-25's MIME fix holds over 20,000 random names (17 platfor…
Nucs Nov 10, 2026
fc0fbca
docs(qa): QA-46's slice-plot fix holds over 500 random constrained st…
Nucs Nov 10, 2026
6c1726a
docs(qa): QA-66 also breaks BaseStorage.GetTrialParam's documented Ke…
Nucs Nov 10, 2026
bd18241
docs(qa): SQLAlchemy URL parsing matches make_url over 5,000 random U…
Nucs Nov 10, 2026
7b9b2be
test(qa): QA-69 gRPC proxy dict order changes QMC / BruteForce trajec…
Nucs Nov 10, 2026
f3ac844
docs(qa): QA-53's root cause is GPSampler.ColumnMax skipping NaN (E12)
Nucs Nov 10, 2026
fae14c5
test(qa): QA-71 Optuna's SQLite storage reads attributes in key order…
Nucs Nov 10, 2026
00ca49c
test(qa): QA-72 the OptunaHub sampler bridge drops after_trial and th…
Nucs Nov 10, 2026
f296e2c
test(qa): QA-73 successive halving and Hyperband never prune through …
Nucs Nov 10, 2026
540fc65
test(qa): QA-74 EF Core storage throws DbUpdateException where Optuna…
Nucs Nov 11, 2026
9dd607b
docs(qa): random-program fuzz on MySQL and PostgreSQL matches across …
Nucs Nov 11, 2026
8475c54
docs(qa): artifacts across languages and the Redis journal backend ma…
Nucs Nov 11, 2026
cde01ad
docs(qa): the OptunaHub problem bridge matches native Python on five …
Nucs Nov 11, 2026
924942b
test(qa): QA-75 the schema-compatibility error names Optuna's version…
Nucs Nov 11, 2026
129e5e9
docs(qa): heartbeat stale-trial recovery matches across languages (E1…
Nucs Nov 11, 2026
829759e
test(qa): QA-76 the LightGBM pruning callback prints scores in C# cul…
Nucs Nov 11, 2026
beb5c3c
test(qa): QA-76 also covers the LightGBM tuner's alias warning and me…
Nucs Nov 11, 2026
ac12307
docs(qa): OptunaHub value marshalling and the BoTorch bridge match na…
Nucs Nov 11, 2026
231bffb
docs(qa): mixed Python / C# fleets through gRPC proxy servers of both…
Nucs Nov 11, 2026
6958426
docs(qa): QA-71 reorders get_all_artifact_meta on SQLite (E43b)
Nucs Nov 11, 2026
1331b4e
docs(qa): the NRedisStack and ServiceStack journal backends match Sta…
Nucs Nov 11, 2026
dd9445e
docs(qa): FrozenTrial equality ignores key order like Python; run-2 r…
Nucs Nov 11, 2026
03e27f2
test(qa): QA-77 set_verbosity(ERROR) hides the port's warnings, which…
Nucs Nov 11, 2026
a4002c3
docs(qa): a mixed Python / C# CMA-ES fleet shares its optimizer pickl…
Nucs Nov 11, 2026
c19caba
docs(qa): mixed Python / C# NSGA-II and Grid fleets on one journal ar…
Nucs Nov 11, 2026
b53e322
test(qa): QA-78 download_artifact onto an existing directory fails wi…
Nucs Nov 11, 2026
daa57b9
test(qa): QA-79 multi-objective TPE ignores Optuna's study.direction …
Nucs Nov 11, 2026
43b3947
test(qa): QA-80 CMA-ES samples on from an out-of-bounds mean where cm…
Nucs Nov 11, 2026
1492074
test(qa): QA-80 also covers cmaes' learning-rate assertions (CmaEsSam…
Nucs Nov 11, 2026
67e4e5c
docs(qa): constructor-validation matrix, use-after-finish, best_trial…
Nucs Nov 11, 2026
9c84c48
docs(qa): PyCma bridge matches optuna-integration under cma 4.4.4; di…
Nucs Nov 11, 2026
5230556
test(qa): QA-81 OptunaSearchCV(nJobs: 0) throws where optuna-integrat…
Nucs Nov 11, 2026
6302df6
docs(qa): terminator constructors clean (E62); first draft of the run…
Nucs Nov 11, 2026
a0979d1
test(qa): QA-82 BoTorch bridge's two-objective qEHVI suggestion drift…
Nucs Nov 11, 2026
01a0d8c
docs(qa): QA-82 narrowed to the parameter suggestion order
Nucs Nov 11, 2026
f628a1f
docs(qa): correct QA-82 — the suggestion order is not its cause
Nucs Nov 11, 2026
79c2468
docs(qa): QA-82 is confined to the multi-objective qEHVI path
Nucs Nov 11, 2026
929bbe7
test(qa): QA-82 raised to MEDIUM — over two floats the BoTorch bridge…
Nucs Nov 11, 2026
34ae92b
docs(qa): QA-82 is confined to the Monte-Carlo qEHVI path
Nucs Nov 11, 2026
6a75651
test(qa): QA-83 CMA-ES x0 missing a parameter fails with KeyNotFoundE…
Nucs Nov 11, 2026
ab4d2f3
docs(qa): last quick checks clean (E65); summary lists the BoTorch br…
Nucs Nov 11, 2026
4b65852
docs(qa): parity QA run 2 ends — 28 findings QA-56..QA-83, 37 repro t…
Nucs Nov 11, 2026
5440021
perf(qmc): keep the scrambled Sobol and Halton engines across trials;…
Nucs Nov 11, 2026
2189a12
perf(tpe): hash the stepped branch's dedups and keep the continuous s…
Nucs Nov 11, 2026
9346647
test(qa): QA-84 TPE sums the continuous dimensions left to right wher…
Nucs Nov 11, 2026
cebb1c9
perf(gp): sweep triangular solves over all right-hand sides, fuse Cho…
Nucs Nov 11, 2026
9533366
perf(gp): give the forked regressor (TuRBO, SAASBO, REMBO toolkit) st…
Nucs Nov 11, 2026
c78c0ab
perf(bruteforce): one path buffer per tree rebuild, candidate lists c…
Nucs Nov 11, 2026
ca6723d
perf(tpe): split trials without per-trial constraint dictionaries or …
Nucs Nov 11, 2026
5019c5d
perf(tpe): build Parzen kernels straight into their prior-extended ar…
Nucs Nov 11, 2026
882a043
perf(es): build the evolution-strategy samplers' attribute keys once;…
Nucs Nov 11, 2026
4367338
perf(samplers): size DE, PSO, LM-CMA, VkD-CMA and JANUS history lists…
Nucs Nov 11, 2026
d7aa9d9
fix(tpe): skip the by-number sort of an already ordered side; step F …
Nucs Nov 11, 2026
998bc21
docs(plan-15): results through d521e16 - every workload base vs tree,…
Nucs Nov 11, 2026
8b0fb61
perf(tpe): share one filtered history per trial snapshot and read the…
Nucs Nov 11, 2026
66f83d4
perf(sms-emoa,moead): find population members by number with a binary…
Nucs Nov 11, 2026
9edc1d4
perf(de): parse the stored optimizer state once per generation, not o…
Nucs Nov 11, 2026
af20df1
perf(lm-cma,pso,vkd-cma): parse the stored optimizer state once per g…
Nucs Nov 11, 2026
adc76c2
perf(es): SNES, xNES and OpenAI-ES parse their stored optimizer state…
Nucs Nov 11, 2026
9d94a6a
perf(samplers): read 21 per-ask NumSharp draws through NumPyDraws, so…
Nucs Nov 11, 2026
8c52e7c
perf(study): compile the history state filter optimized from its firs…
Nucs Nov 11, 2026
cc1e4f3
perf(samplers): CMA-ES and ten other sample paths dispose their Gauss…
Nucs Nov 11, 2026
283876b
docs(plan-15): done - 17 bit-identical steps and one fix; final surve…
Nucs Nov 11, 2026
0e18eba
refactor(core): MathUtil.Log1p / Expm1 / LogAddExp delegate to NumSha…
Nucs Nov 11, 2026
c600736
fix(parity): Optuna's 1-D np.dot / @ / np.linalg.norm go through NumS…
Nucs Nov 11, 2026
156ce8a
fix(parity): reductions follow NumPy's order through NumSharp - CV va…
Nucs Nov 11, 2026
7b34a23
docs(parity): record the NumSharp migration - QA-22 / QA-54 fixed, QA…
Nucs Nov 11, 2026
128761d
fix(parity): NSGA-III reference-point association matches Optuna from…
Nucs Nov 11, 2026
8a7e19e
fix(parity): second NumSharp pass - GP grids and rounding (QA-49), Nu…
Nucs Nov 11, 2026
fb6cd20
docs(parity): record the second NumSharp pass - QA-86..QA-89 filed (t…
Nucs Nov 11, 2026
27269b1
chore(build): NumSharp's JIT posture - TieredCompilation + TieredPGO …
Nucs Nov 12, 2026
6e09665
docs(parity): revalidate QA-56..QA-83 on a3e4d45 - all 28 still open;…
Nucs Nov 12, 2026
4ae4a1f
fix(journal): wait out a lock file deleted in place on Windows (bound…
Nucs Nov 12, 2026
465f91c
fix(tpe)!: QA-84 - the continuous log density sums its dimensions wit…
Nucs Nov 12, 2026
3809bae
fix(parity): apply the owner's decisions on QA-57, QA-65, QA-69, QA-7…
Nucs Nov 12, 2026
1283d19
docs(plan-15): §8 follow-ups - the owner's decisions of 2026-11-12: j…
Nucs Nov 12, 2026
1e8aba6
fix(cmaes): QA-60 / QA-80 / QA-83 - CMA-ES fails where Optuna and cma…
Nucs Nov 12, 2026
d510728
fix(cli): QA-61 / QA-63 / QA-64 - PyYAML's safe_dump ported for -f ya…
Nucs Nov 12, 2026
f90930c
docs(plan-15): closed - QA-84's TPE cost kept until NumSharp fixes it…
Nucs Nov 12, 2026
3009c4a
fix(parity): QA-66 / QA-74 / QA-75 / QA-76 / QA-78 / QA-79 / QA-81 - …
Nucs Nov 12, 2026
16a7f9e
fix(parity): QA-56 / QA-59 / QA-67 / QA-68 / QA-71 - CPython's own or…
Nucs Nov 12, 2026
ed754e4
fix(interop): QA-72 / QA-73 - the OptunaHub bridges keep a persistent…
Nucs Nov 12, 2026
4d4151e
fix(cmaes): keep CmaEsSampler's 1.0.0 constructor signature, so assem…
Nucs Nov 12, 2026
70cda21
docs: cite the rebased hashes - the 1.1.0 release line was rebased on…
Nucs Nov 12, 2026
2f323b0
ci(release): name and fill the GitHub Release from docs/releases/RELE…
Nucs Nov 12, 2026
e3a25cb
docs(release): 1.1.0 release notes in NumSharp's house style - all 12…
Nucs Nov 12, 2026
6fa30e7
docs: OptunaSharp needs dynamic code - the NativeAOT / PublishAot=fal…
Nucs Nov 12, 2026
1d42832
docs(release): the 1.1.0 notes account for the NativeAOT documentatio…
Nucs Nov 12, 2026
38735c2
docs(release): the 1.1.0 notes list every seeded result the NumSharp …
Nucs Nov 12, 2026
9d3285f
chore(deps)!: NumSharp 0.81.0, with NumPy 2.5.4 as the byte-exact tar…
Nucs Nov 14, 2026
9f77939
fix(parity): Python's OverflowError, ZeroDivisionError, FileExistsErr…
Nucs Nov 14, 2026
1592d05
refactor(collections): NumSharp 0.81.0's ConcurrentOrderedDictionary …
Nucs Nov 14, 2026
784f495
test(numsharp): pin the hand-written sequential products to NumSharp …
Nucs Nov 14, 2026
5b0e4fd
test(qa): QA-17 and QA-34 lose [OpenBugs] - fixed by 1e8aba6 with run…
Nucs Nov 14, 2026
8e7418e
test(interop): restore np.row_stack for the pinned pymoo 0.6.1.3 unde…
Nucs Nov 14, 2026
8c31fb6
docs(release): the 1.1.0 notes on NumSharp 0.81.0 - NumPy 2.5.4 as th…
Nucs Nov 14, 2026
7d73f5a
test(ci): the release-matrix rehearsal's findings - four bit-exact ga…
Nucs Nov 14, 2026
4cbbef1
fix(ci): no forced Haswell kernels on AMD Zen 4/5 - OpenBLAS 0.3.34's…
Nucs Nov 14, 2026
07f8232
docs(release): the 1.1.0 notes record the OpenBLAS 0.3.34 fault behin…
Nucs Nov 14, 2026
cd689d5
fix(ci): the Haswell-pin exception is Windows-only - Linux on Zen 4 r…
Nucs Nov 14, 2026
6bed3d7
test(rembo): REMBO's 16-worker no-repeat row moves to [OpenBugs] - it…
Nucs Nov 14, 2026
b3316c4
docs(release): the 1.1.0 notes record REMBO's open bug - its 16-worke…
Nucs Nov 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ OptunaSharp/
│ │ ├── Version.cs # OptunaSharp.OptunaSharpVersion (the version constant)
│ │ └── README.md # packed into the .nupkg
│ └── OptunaSharp.*/ # optional satellite packages — Storage.{Sqlite,EFCore,Grpc,Redis,…}, Visualization.Plotly, Integration.{LightGbm,ML.NET}, Interop.{pythonnet,BoTorch,PyCma}, Artifacts.{S3,Gcs,AzureBlob,R2}, Cli
├── refs/ # reference-only pinned submodules (NOT built) — optuna @ v5.0.0 (01ddd17, the porting reference), NumSharp @ v0.80.0, optunahub @ v0.5.0, optuna-integration @ v5.0.0, shap, scikit-learn
├── refs/ # reference-only pinned submodules (NOT built) — optuna @ v5.0.0 (01ddd17, the porting reference), NumSharp @ v0.81.0, optunahub @ v0.5.0, optuna-integration @ v5.0.0, shap, scikit-learn
├── test/
│ ├── OptunaSharp.Tests/ # unit tests — MSTest v3 + AwesomeAssertions
│ ├── OptunaSharp.Tests.Interop/ # LIVE-Optuna parity harness (pythonnet)
Expand Down Expand Up @@ -133,18 +133,21 @@ package dependency** (see below), not a solution member.
`OptunaSharp.Core` depends on **NumSharp** and its native LAPACK/CBLAS backend
**NumSharp.Interop.OpenBLAS**, both consumed as **NuGet packages from nuget.org** (SciSharp STACK) —
two plain `PackageReference`s in `OptunaSharp.Core.csproj`, versioned by the single-sourced
`$(NumSharpVersion)` property in `Directory.Build.props` (currently `0.80.0`; bump that one value to
move to a newer release). **Build and CI restore these from nuget.org, always** — there is no submodule
`$(NumSharpVersion)` property in `Directory.Build.props` (currently `0.81.0`; bump that one value to
move to a newer release, and move the CI NumPy pin with it, below). **Build and CI restore these from nuget.org, always** — there is no submodule
init and no OpenBLAS-native staging step anymore.

- **OpenBLAS ships the natives.** `NumSharp.Interop.OpenBLAS` carries the prebuilt scipy-openblas
binaries NumPy itself bundles, under `runtimes/<rid>/native/`; the package's `buildTransitive`
targets copy the right RID's natives to the consuming executable/test output automatically (no
`fetch_openblas.py`). So `np.linalg` (cholesky / eigh / solve / matrix_rank / svd / qr) computes
through LAPACK and is **bit-identical to NumPy** (verified byte-for-byte vs numpy 2.4.2) — the basis
through LAPACK and is **bit-identical to NumPy** (0.81.0 bundles numpy 2.5.4's scipy-openblas 0.3.34.106.0;
0.80.0 bundled numpy 2.4.2's) — the basis
for the byte-exact linalg-backed samplers (NSGA-III's hyperplane solve, CMA-ES's eigendecomposition,
the GP stack's Cholesky). OpenBLAS depends on the same NumSharp version, so pack records both as
direct dependencies.
direct dependencies. **The CI NumPy pin follows the bundle:** `build-and-release.yml` and the package-parity
`Dockerfile` pin `numpy==2.5.4` for NumSharp 0.81.0; a NumPy whose OpenBLAS differs moves the seeded CMA-ES,
xNES, UNDX and JANUS results in their last bits and fails their byte-exact oracles.
- **The backend is force-loaded.** OpenBLAS self-registers from its own `[ModuleInitializer]`, but the
CLR runs a referenced assembly's initializer only when the assembly is first touched.
`src/OptunaSharp.Core/Internal/OpenBlasActivation.cs` touches `OpenBlasEngine.LapackAvailable` from
Expand Down Expand Up @@ -359,7 +362,18 @@ Rules every workflow follows:
a `Test (slow)` step runs the `Slow` category on Linux for `v*` tags and manual dispatch (dispatch input
`run_slow`, default on; off skips ~2 h of BoTorch parity when re-checking an OS leg). The `setup`
job decides the matrix per trigger: push = ubuntu+windows × both TFMs, PR = net10.0 only,
tags/dispatch = +macOS.
tags/dispatch = +macOS. On Windows the unit tests run with `--blame-crash`, so a test host that crashes leaves
the test sequence (`Sequence_*.xml`), and a mini dump when the runtime sees the crash, in the
`test-results-windows-2025` artifact.
- **The OpenBLAS kernel pin** — every x64 test step sources `.github/scripts/openblas_coretype.sh`, which exports
`OPENBLAS_CORETYPE=Haswell` (the kernels the committed linalg oracles were captured on) EXCEPT on Windows on AMD
CPUs with AVX-512 (Zen 4/5, e.g. the EPYC 9V74 / 9V45 runners): there the Windows build of NumSharp 0.81.0's
OpenBLAS 0.3.34.106.0 running forced Haswell kernels faults with an access violation in JANUS-DE's quadratic chart
(found 2026-11-14 by the `ci/win-crash-diag` runs; OpenBLAS's own kernel choice and 0.3.31 both pass), so OpenBLAS
chooses and the Haswell-captured oracles (AGE-MOEA-2's linalg cases, the CMA-ES state oracle, the xNES digest)
report Inconclusive through an `OpenBlasEngine.CoreName == "Haswell"` guard. Linux keeps the pin on every CPU:
forced Haswell passes on Linux Zen 4, and unpinned it breaks the live `LongRun_40D_FullState_IsBitIdentical`
gate. A new oracle captured on Haswell kernels needs the same guard.
- **`satellite-tests`** — ubuntu + windows on every trigger, never macOS: the arm64 runner has no ML.NET
LightGBM native and cannot host the Linux service containers. It runs every other `test/OptunaSharp.Tests.*` suite (Storage,
Artifacts, Cli, Hosting, Importance.*, Integration.*, Benchmark.VolleyEval); Interop and
Expand Down
52 changes: 52 additions & 0 deletions .github/scripts/openblas_coretype.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/usr/bin/env bash
# Sourced by the test steps of build-and-release.yml: decides OpenBLAS's kernel family for this runner and exports
# OPENBLAS_CORETYPE accordingly.
#
# Why a pin at all: OpenBLAS (a DYNAMIC_ARCH build, both in NumSharp.Interop.OpenBLAS and in NumPy's wheels) picks its
# kernels per CPU. The committed linalg oracles (AGE-MOEA-2's operator parity, the CMA-ES state oracle, the xNES digest)
# were captured on its Haswell kernels, and the other families (SkylakeX / Zen on AVX-512 hosts) land 1-2 ULP away, so
# CI pins Haswell on x64; every x64 runner has the AVX2/FMA those kernels need.
#
# The one exception, Windows on an AMD CPU with AVX-512: NumSharp 0.81.0 bundles OpenBLAS 0.3.34.106.0, whose WINDOWS
# build running FORCED Haswell kernels on Zen 4 / Zen 5 (the EPYC 9V74 and 9V45 runners) faults with an access violation
# (0xC0000005) inside JANUS-DE's quadratic chart, on net8.0 and net10.0, with one OpenBLAS thread or four, with .NET's
# AVX-512 on or off. On the same machines OpenBLAS's own kernel choice passes, and so does NumSharp 0.80.0's OpenBLAS
# 0.3.31.22.0 with the pin; AMD EPYC 7763 (Zen 3) and the Intel Xeons pass every way. Found 2026-11-14 by the diagnostic
# runs 43548926143, 43549856491 and 43550350376 (throwaway branch ci/win-crash-diag). There the pin is left off:
# OpenBLAS chooses, and the oracle guards (OpenBlasEngine.CoreName must be "Haswell") report the Haswell-captured cases
# Inconclusive instead of red.
#
# Linux keeps the pin on every CPU: the same console repro with Haswell forced passed on three Linux EPYC 9V74 (Zen 4)
# runners, both TFMs (run 43553335934, branch ci/linux-haswell-check), and leaving the pin off there broke a live
# byte-for-byte gate (CmaEsSamplerParityTests.LongRun_40D_FullState_IsBitIdentical on an AMD AVX-512 runner,
# rehearsal 43551908135), so the exception would cost a parity gate for nothing.
#
# Usage: source "$GITHUB_WORKSPACE/.github/scripts/openblas_coretype.sh" (bash; reads RUNNER_ARCH and RUNNER_OS)
# Effect: exports OPENBLAS_CORETYPE=Haswell or unsets it, and prints one line saying which and why. Off x64 (the macOS
# arm64 runner) it does nothing: Haswell kernels do not exist there.

# True on an AMD CPU with AVX-512 (Zen 4 and later). Windows asks .NET through PowerShell 7, which every hosted Windows
# runner has; it is tested first because Git Bash also has a /proc/cpuinfo (MSYS2's emulation), whose flag list is not
# known to name AVX-512. Elsewhere it reads the kernel's /proc/cpuinfo. Anything it cannot tell counts as "not AMD with
# AVX-512", i.e. pinned.
openblas_amd_avx512() {
if [[ "${RUNNER_OS:-}" == "Windows" || "$(uname -s)" == MINGW* || "$(uname -s)" == MSYS* ]]; then
command -v pwsh >/dev/null 2>&1 || return 1
[[ "$(pwsh -NoProfile -NonInteractive -Command '[Console]::Write(((Get-CimInstance Win32_Processor | Select-Object -First 1).Manufacturer -eq "AuthenticAMD") -and [System.Runtime.Intrinsics.X86.Avx512F]::IsSupported)')" == "True" ]]
elif [[ -r /proc/cpuinfo ]]; then
grep -m1 '^vendor_id' /proc/cpuinfo | grep -q AuthenticAMD && grep -qw avx512f /proc/cpuinfo
else
return 1
fi
}

if [[ "${RUNNER_ARCH:-}" == "X64" ]]; then
# The exception applies to Windows only (see above); Linux and any other x64 host keep the pin.
if [[ "${RUNNER_OS:-}" == "Windows" ]] && openblas_amd_avx512; then
unset OPENBLAS_CORETYPE
echo "OpenBLAS: Windows on an AMD CPU with AVX-512, Haswell pin left off (OpenBLAS 0.3.34's forced Haswell kernels fault there); the Haswell-captured oracles report Inconclusive"
else
export OPENBLAS_CORETYPE=Haswell
echo "OpenBLAS: OPENBLAS_CORETYPE=Haswell (the kernels the committed linalg oracles were captured on)"
fi
fi
Loading
Loading