GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — native preview: CPU baseline check for images above the platform baseline (x86-64-v3, armv8.1-a) by tae898 · Pull Request #489 · humemai/arcadedb-embedded-python

This repository was archived by the owner on Nov 21, 2026. It is now read-only.

Conversation

@tae898

@tae898 tae898 commented Oct 23, 2026

Copy link
Copy Markdown

Note on the base: the native preview wheel (arcadedb-embedded-native) is not on main yet. It lives on the native-* branches, and native-inline is the newest tip, so this PR is based on native-inline, not main.

What

arcadedb_embedded/_native/cpu.py is a pure-Python CPU baseline check that runs before libarcadedb is loaded. A CPU below the image's baseline gets an ArcadeDBError that names the missing features, the baseline, the JVM fallback (arcadedb-embedded) and ARCADEDB_NATIVE_SKIP_CPU_CHECK=1, instead of Illegal instruction.

Why, and what the baseline really is

An image that needs more than the CPU has dies with Illegal instruction and no message. That is what a user sees after pip install on a Proxmox VM with the default CPU type, on a Celeron/Pentium N/J (J4125, N5105), or on a Raspberry Pi 4 / AWS Graviton1 (no LSE atomics).

The shipped wheels do not have this problem: native-spike/scripts/preview-build.sh defaults to MARCH=compatibility (line 16, passed as -march=$MARCH on line 27) and .github/workflows/native-preview.yml sets MARCH: compatibility for all four platforms. That is baseline x86-64 and generic armv8-a, and it runs on every CPU in the examples above. GraalVM CE's own default (x86-64-v3 / armv8.1-a) only applies to a reference image built with MARCH=x86-64-v3 or a local build with the default. So the check is a guard for those images, and it is a no-op for the published wheels: it must not refuse a Celeron or a Pi 4 on a compatibility wheel, because that wheel runs there.

lib.py::_check_cpu already existed for this case but only knew avx2, bmi2 and fma, only Linux x86-64, and had no tests. This PR replaces it with the full list and covers the other platforms.

How it detects

Platform Source
Linux x86-64 flags line of /proc/cpuinfo: avx, avx2, bmi1, bmi2, fma, f16c, lzcnt (or abm), movbe (the v3 list of ArcadeData#10624)
Linux arm64 Features line: atomics (LSE), only for an armv8.1-a image
Windows x86-64 IsProcessorFeaturePresent(40) (AVX2) via ctypes
macOS not checked: Apple Silicon is always fine and there is no Intel macOS wheel

If the information cannot be read (no /proc, empty flags, any exception) it logs at debug and continues. ARCADEDB_NATIVE_SKIP_CPU_CHECK=1 skips the check. Nothing is checked for -march=compatibility.

Docs

native-wheel/README.md has a new "CPU requirements" section (baseline, machines below v3, fallback), and build-architecture.md and the build_wheel.py comment point at cpu.py. The repo keeps no changelog.

Tests

bindings/python/tests/test_native_cpu_check.py, 12 tests on fake cpuinfo and feature sets: v3 present (also LZCNT as lzcnt), AVX2 missing (J4125-like), Proxmox default CPU, Pi 4 without atomics, arm64 with atomics, compatibility never checks, unreadable CPU does not block, skip env var, Windows AVX2, macOS and unknown machines. PYTHONPATH=src uv run --no-project --with pytest --with jpype1 --with numpy pytest tests/test_native_cpu_check.py --noconftest: 12 passed. The CI legs build and parity-test the wheel on the four platforms.

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tae898 @claude
native preview: CPU baseline check for images above the platform base…
42b9c74
…line (x86-64-v3, armv8.1-a)

The shipped wheels are built with -march=compatibility and run on every CPU of their platform. A reference image built for GraalVM's default baseline
died with "Illegal instruction" on an older CPU. _native/cpu.py checks all eight x86-64-v3 features (was avx2, bmi2, fma), LSE atomics for armv8.1-a on
arm64 Linux and AVX2 on Windows, never blocks when the CPU cannot be read, and ARCADEDB_NATIVE_SKIP_CPU_CHECK=1 skips it. Unit tests on fake cpuinfo;
README section "CPU requirements".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@tae898
tae898 marked this pull request as draft October 23, 2026 15:54
Base automatically changed from native-inline to native-preview October 24, 2026 05:44
@tae898

tae898 commented Oct 24, 2026

Copy link
Copy Markdown
Author

Not needed: the native wheel ships -march=compatibility, and the laptop A/B (native-compat, reportable, A/A clean) puts its cost against x86-64-v3 at no more than about 5% on write and load paths, with queries and vector search unchanged (numbers on ArcadeData#10581). A CPU check only matters for an image above the platform baseline, which we do not ship.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tae898 tae898 closed this Oct 24, 2026
@tae898
tae898 deleted the native/cpu-baseline-check branch November 8, 2026 11:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@tae898
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.