Skip to content

feat: add Linux support and CI benchmark workflow - #4

Merged
xmnlab merged 3 commits into
arxlang:mainfrom
Krishna27Singh:feat/linux-benchmark-workflow
Nov 27, 2026
Merged

xmnlab merged 3 commits into
arxlang:mainfrom
Krishna27Singh:feat/linux-benchmark-workflow

Conversation

@Krishna27Singh

Copy link
Copy Markdown
Contributor

Summary

Adds Linux compatibility to harness/bench.py, optional --ci run count overrides in benchmark.toml, and a Linux GitHub Actions benchmark workflow (.github/workflows/bench.yaml).

What Changed

  • harness/bench.py:
    • Added Linux CPU detection (/proc/cpuinfo with lscpu and platform fallbacks).
    • Guarded the conda clang warning so it only runs on macOS.
    • Updated NUMBA_PYTHON fallback to use sys.executable / python3 instead of a macOS conda path.
    • Added optional --ci flag reading [case.ci] runs/warmup overrides (with --quick taking precedence) and optional BENCH_ARX_INSTALL recording in environment.json.
  • suites/fibonacci/benchmark.toml: Added [case.ci] run/warmup overrides for CI runtime budgeting without changing local defaults.
  • .github/workflows/bench.yaml: Manual (workflow_dispatch with quick and arx_spec inputs) and weekly (0 4 * * 0) Linux workflow running arx and c together in arx-c (for like-for-like ratios) and the remaining languages in separate matrix jobs, uploading one artifact per job.
  • tests/ & README.md: Added unit tests for Linux compatibility and CI overrides (tests/test_linux_ci.py, tests/test_manifests.py) and documented workflow usage and shared-runner variance in README.md.

Verification

  • Local unit tests: python3 -m unittest discover -s tests -v (23 passed).
  • Tested .github/workflows/bench.yaml on my fork in both --quick and --ci modes: all 8 matrix jobs passed and produced 8 artifacts.
  • Unpacked bench-arx-c.zip locally and verified python3 harness/bench.py report renders all Fibonacci tables and Linux environment metadata cleanly.

@xmnlab

xmnlab commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Thanks for the PR! The Linux support and CI benchmark workflow look good overall.

Just one small security improvement before merging:

In ".github/workflows/bench.yaml", the "arx_spec" workflow input is interpolated directly into shell commands using "${{ inputs.arx_spec }}". Since this is user-controlled input, it could allow unintended shell command execution.

Could you pass the value through a step-level environment variable (e.g., "ARX_SPEC") and reference it as ""$ARX_SPEC"" instead? Please apply the same approach when recording "BENCH_ARX_INSTALL".

Also, while touching the documentation, please update the "NUMBA_PYTHON" default in "README.md" to reflect the new "sys.executable" / "python3" fallback.

That's all from my side. No additional refactoring or tests are necessary.

@Krishna27Singh

Copy link
Copy Markdown
Contributor Author

Thanks for catching that @xmnlab! Pushed a follow up commit addressing both points:

  • Passed inputs.arx_spec (and inputs.quick) through step level env: variables (ARX_SPEC, QUICK) instead of interpolating ${{ inputs.* }} directly in run: blocks.
  • Set BENCH_ARX_INSTALL directly via step level env: on the Run benchmarks step (scoped to matrix.name == 'arx-c') instead of writing it through $GITHUB_ENV.
  • Updated the documented NUMBA_PYTHON default in README.md to reflect the sys.executable / python3 fallback.

All 23 unit tests and workflow YAML checks pass locally. Thanks for the review!

@xmnlab

xmnlab commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Thanks for the updates, @Krishna27Singh ! Could you add a checked-in Conda environment for the benchmarks and use it for both local runs and GitHub Actions? Please include Python and pip as Conda dependencies, declare the required Python packages in the pip: section, and pin the benchmark versions, including Numba and the default Arx release. That gives us one place to define the baseline environment and lets contributors recreate it locally.

A root-level conda.yaml is fine for a single environment. If multiple environments are needed, we usually put them under conda/. You can use Arx’s conda/dev.yaml as a reference.

@Krishna27Singh

Copy link
Copy Markdown
Contributor Author

Thanks @xmnlab for the review!
Added a checked-in root level conda.yaml and wired it into both the CI workflow and local docs:

  • conda.yaml: Single arx-benchmarks environment (nodefaults + conda-forge) with Conda python=3.12.* and pip, pinning arxlang==1.30.0 and numba==0.68.1 under pip: (both resolve cleanly together on llvmlite==0.50.0).
  • .github/workflows/bench.yaml: Switched to conda-incubator/setup-miniconda@v3 with environment-file: conda.yaml and bash -el {0}, matching arx/.github/workflows/main.yaml. Left inputs.arx_spec blank by default so conda.yaml is the single source of truth for the pinned Arx release (recording it into BENCH_ARX_INSTALL on arx-c and only running pip install --upgrade "$ARX_SPEC" when an override is provided).
  • README.md: Documented creating and activating conda.yaml locally for contributors and updated version/workflow guidance.

Verified locally by creating a fresh environment from conda.yaml (arx 1.30.0, numba 0.68.1, bench.py check --lang arx,c,python,numba all passing), running all 23 unit tests, and running the updated workflow in --quick mode on my fork (all 8 matrix jobs passed). Ready for another look!

@xmnlab
xmnlab merged commit 8c8380c into arxlang:main Nov 27, 2026
4 checks passed
@xmnlab

xmnlab commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

thanks @Krishna27Singh
appreciate it

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