Skip to content

Support 32-bit platforms and add a 32-bit CI lane via test_groups.toml#97

Merged
ChrisRackauckas merged 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:support-32bit-platforms
Jul 12, 2026
Merged

Support 32-bit platforms and add a 32-bit CI lane via test_groups.toml#97
ChrisRackauckas merged 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:support-32bit-platforms

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Supersedes #95. Same 32-bit source support, but the CI lane is declared through the matrix (test/test_groups.toml) instead of a hand-added tests.yml job — and it fixes a real gap that made #95's own suite error on 32-bit.

What changed

Source

  • src/simd_ir.jl — the LLVM-IR SIMD kernels are typed for 64-bit lengths/pointers, so guard them behind @static if Sys.WORD_SIZE == 64 and add a portable scalar fallback _scalar_first backing every primitive on 32-bit. (From Support 32-bit platforms #95.)
  • src/equality.jl — pass lengths as Int64 explicitly (from Support 32-bit platforms #95), and add a generic findfirstsortedequal fallback. Unlike findfirstequal, findfirstsortedequal had only the (Int64, DenseVector{Int64}) method. On 32-bit, native Int is Int32, so findfirstsortedequal(::Int32, ::Vector{Int32}) threw MethodError8385 such errors in the suite (this is why Support 32-bit platforms #95 as-is does not actually pass on 32-bit). The new method is a generic searchsortedfirst + equality post-check, mirroring findfirstequal's fallback, so it works for any sorted vector on any platform.

CI (the point of this PR)

Instead of #95's hand-added tests-32bit job in Tests.yml, add a "Core 32-bit" section to test/test_groups.toml:

["Core 32-bit"]
group = "Core"        # dispatch the Core body (folder resolves) on GROUP=Core
versions = ["1"]
os = ["ubuntu-latest"]
arch = "x86"

Tests.yml stays a thin caller of grouped-tests.yml@v1. This relies on the new arch axis and group alias added to the SciML/.github matrix generator in SciML/.github#113 — that PR must merge and v1 be retagged before the lane activates in CI.

Tests & version

  • Added an explicit _scalar_first-vs-findfirst parity test (from Support 32-bit platforms #95) and a new generic-findfirstsortedequal fallback test (Int32/Int16/Float32), so both paths are exercised on 64-bit CI too.
  • Minor version bump 3.0.3 → 3.1.0 (new public behavior: findfirstsortedequal now accepts any sorted vector).

Local verification (actually run, not inferred)

  • 32-bit i686 Julia 1.11.9 (juliaup add 1.11~x86), GROUP=Core Pkg.test(): passes, 0 errors with the fix. Without the generic fallback it errored 8385 times — confirmed and root-caused.
  • x64, final state incl. new testset: passes, 171915 tests.
  • Both changed .jl files are Runic-clean.

Dependency

Blocked on SciML/.github#113 (arch axis + group alias). Until v1 includes it, the arch/group keys are inert and the existing 64-bit matrix is unchanged (verified: no-arch test_groups.toml output is byte-identical to before).

Please ignore until reviewed by @ChrisRackauckas.

🤖 Generated with Claude Code

… broken 32-bit CI job

Follow-up to SciML#95. Two things:

1. Fix a correctness gap SciML#95 shipped. Unlike `findfirstequal`,
   `findfirstsortedequal` had ONLY the `(Int64, DenseVector{Int64})` method
   and no generic fallback. On 32-bit platforms native `Int` is `Int32`, so
   `findfirstsortedequal(::Int32, ::Vector{Int32})` throws MethodError — 8385
   such errors in the suite, and a bare `Pkg.test()` / any `Int`-vector caller
   on 32-bit is broken. Add a generic `searchsortedfirst` + equality post-check
   fallback (mirroring `findfirstequal`), so it works for any sorted vector on
   any platform. Add a test covering the fallback on Int32/Int16/Float32.

2. Remove the `tests-32bit` job SciML#95 added to Tests.yml. Running 32-bit Julia on
   the 64-bit `ubuntu-latest` runner fails at `setup-julia` (the i686 binary
   can't exec without the 32-bit loader, which is not installed before Julia is
   invoked: `spawn .../x86/bin/julia ENOENT`), so that job is red regardless of
   this fix. A proper 32-bit CI lane needs runner/reusable-workflow changes and
   is deferred; Tests.yml goes back to a thin grouped-tests caller.

Minor bump 3.0.3 -> 3.1.0 (new public behavior: `findfirstsortedequal` now
accepts any sorted vector). Verified locally: full Core suite passes on 32-bit
i686 Julia 1.11 (0 errors) and on x64 (171915 tests); GROUP=All passes.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EcQkauMQ4KSytnTpJpXUZu
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review July 12, 2026 12:20
@ChrisRackauckas
ChrisRackauckas merged commit 6bd7486 into SciML:main Jul 12, 2026
22 of 23 checks passed
ChrisRackauckas added a commit that referenced this pull request Jul 12, 2026
* Add generic findfirstsortedequal fallback (fixes 32-bit) and drop the broken 32-bit CI job

Follow-up to #95. Two things:

1. Fix a correctness gap #95 shipped. Unlike `findfirstequal`,
   `findfirstsortedequal` had ONLY the `(Int64, DenseVector{Int64})` method
   and no generic fallback. On 32-bit platforms native `Int` is `Int32`, so
   `findfirstsortedequal(::Int32, ::Vector{Int32})` throws MethodError — 8385
   such errors in the suite, and a bare `Pkg.test()` / any `Int`-vector caller
   on 32-bit is broken. Add a generic `searchsortedfirst` + equality post-check
   fallback (mirroring `findfirstequal`), so it works for any sorted vector on
   any platform. Add a test covering the fallback on Int32/Int16/Float32.

2. Remove the `tests-32bit` job #95 added to Tests.yml. Running 32-bit Julia on
   the 64-bit `ubuntu-latest` runner fails at `setup-julia` (the i686 binary
   can't exec without the 32-bit loader, which is not installed before Julia is
   invoked: `spawn .../x86/bin/julia ENOENT`), so that job is red regardless of
   this fix. A proper 32-bit CI lane needs runner/reusable-workflow changes and
   is deferred; Tests.yml goes back to a thin grouped-tests caller.

Minor bump 3.0.3 -> 3.1.0 (new public behavior: `findfirstsortedequal` now
accepts any sorted vector). Verified locally: full Core suite passes on 32-bit
i686 Julia 1.11 (0 errors) and on x64 (171915 tests); GROUP=All passes.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EcQkauMQ4KSytnTpJpXUZu

* Add the 32-bit CI lane via test_groups.toml

Declare a `Core 32-bit` matrix-only alias that dispatches the Core body
(group = "Core") on a single x86 Julia cell, so the WORD_SIZE != 64 scalar
fallbacks in src/simd_ir.jl are exercised in CI — replacing #95's hand-added
`tests-32bit` job (removed in the parent commit) with a declarative lane.

This uses the arch axis / group alias in SciML/.github v1 (v1.24.0) and the
i386 runtime-lib install before setup-julia (v1.24.1), so the x86 leg can
actually run on the 64-bit ubuntu runner.

Require `SciMLTesting = "2.2"`: the alias section is skipped by folder discovery
only in SciMLTesting >= 2.2 (SciMLTesting.jl#22), which GROUP=All (the Downgrade
job) and a bare `Pkg.test()` need. FindFirstFunctions runs unchanged on
SciMLTesting 2.x (verified: Core suite passes on 2.1.0).

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EcQkauMQ4KSytnTpJpXUZu

---------

Co-authored-by: ChrisRackauckas-Claude <accounts@chrisrackauckas.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants