SteNicholas opened a new pull request, #181:
URL: https://github.com/apache/paimon-cpp/pull/181

   ### Purpose
   
   Linked issue: close #171
   
   Paimon C++ only built and was validated on x86_64. The architecture-specific 
build logic keyed on `PAIMON_CPU_FLAG` and `PAIMON_ARMV8_ARCH`, neither of 
which was ever defined anywhere in the repository, so the armv8 tuning branch 
was dead code and Arm64 got no `-march=` flag at all.
   
   This change resolves the target architecture once and keys every 
architecture-specific decision on it:
   
   - **`cmake_modules/TargetArchitecture.cmake`** derives 
`PAIMON_TARGET_PROCESSOR` and `PAIMON_TARGET_CPU_FAMILY` from 
`CMAKE_SYSTEM_PROCESSOR`. It runs no compiler probe and reads nothing beyond 
its inputs, so `cmake -P` can test it without a toolchain. An unrecognized 
processor gets no tuning flags rather than a configure error.
   - **`PAIMON_AARCH64_MARCH`** selects the Arm64 `-march=` value, defaulting 
to `armv8-a`. `DefineOptions.cmake` repeats that default as a fallback, because 
the option only exists for a top-level build — an `add_subdirectory()` consumer 
would otherwise configure with a bare `-march=`.
   - **The SSE4.2 CRC32C kernel is removed.** It computed Castagnoli, while the 
checksum persisted in the SST block trailer and in the B-tree global index is 
zlib CRC-32. No on-disk value changes: the kernel hung off the never-defined 
`PAIMON_SIMD_LEVEL`, so no build ever selected it. The tests now pin the class 
to values taken from zlib.
   - **Lumina** is prebuilt for `linux-x86_64` only, so it now fails to 
configure elsewhere with an explicit error, and CI disables it off x86_64.
   - **`build_and_package.sh`** labels artifacts with the platform, so 
`output/paimon-cpp.tar.gz` becomes `output/paimon-cpp-linux-x86_64.tar.gz`. 
`--platform` overrides the label alone — cross compilation is not wired up end 
to end, so each target must be built natively.
   - **CI** gains `gcc-debug-arm64` (on `ubuntu-24.04-arm`), an Arm64 entry in 
release verification, and a `script-tests` job for the new CMake and packaging 
tests. All three are added to the required checks in `.asf.yaml`.
   
   ### Tests
   
   New CMake module tests, run by the `script-tests` CI job via 
`ci/scripts/test_cmake_modules.sh` (both execute standalone with `cmake -P`, no 
toolchain required):
   
   - `cmake_modules/tests/target_architecture_test.cmake` — processor-string 
mapping to `PAIMON_TARGET_PROCESSOR` / `PAIMON_TARGET_CPU_FAMILY` for x86_64, 
aarch64/arm64, 32-bit arm, ppc64le and unknown processors, plus 
case-insensitivity and the empty-processor fallback.
   - `cmake_modules/tests/aarch64_march_option_test.cmake` — 
`PAIMON_AARCH64_MARCH` default, explicit override, and the `add_subdirectory()` 
path where the option is undefined and the fallback must prevent a bare 
`-march=`.
   
   New packaging argument tests, run by the same job via 
`ci/scripts/test_packaging_args.sh`: `build_and_package.sh` argument parsing, 
the default platform label, `--platform` override, and the resulting archive 
name.
   
   Updated unit tests in `src/paimon/common/utils/crc32c_test.cpp` (target 
`unittest`), pinning the checksum to zlib CRC-32 rather than to whichever 
kernel was compiled in:
   
   - `CRC32CTest.TestMatchesZlibCrc32ForAllLengthResidues`
   - `CRC32CTest.TestIsIndependentOfInputAlignment`
   - `CRC32CTest.TestRunningChecksumMatchesSinglePass`
   - `CRC32CTest.TestSeededChecksumMatchesZlibCrc32`
   
   The `gcc-debug-arm64` CI job runs the full unit test suite on 
`ubuntu-24.04-arm`, which is the end-to-end verification that the library 
builds and passes on aarch64.
   
   ### API and Format
   
   No change to the public API under `include/`, and no change to the storage 
format. Removing the SSE4.2 CRC32C kernel does not alter any persisted 
checksum: the kernel was selected by `PAIMON_SIMD_LEVEL`, which was never 
defined, so every existing build already used the zlib CRC-32 path.
   
   Build-facing changes for downstream users: a new `PAIMON_AARCH64_MARCH` 
option, the released archive is now named `paimon-cpp-<platform>.tar.gz` 
instead of `paimon-cpp.tar.gz`, and configuring with lumina enabled off 
`linux-x86_64` now fails explicitly instead of failing later at link time.
   
   ### Documentation
   
   Yes. `docs/source/building.rst` gains a supported platform matrix and 
documents `PAIMON_AARCH64_MARCH` and the platform-labelled packaging output. 
`docs/code-style.md` gains a rule against relying on the signedness of plain 
`char`, which is unsigned by default on aarch64.
   
   ### Generative AI tooling
   
   Generated-by: Claude Opus 5 (1M context)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to