Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
63 changes: 63 additions & 0 deletions .github/workflows/xtajit64-apple-silicon-hotpaths.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: xtajit64 Apple Silicon hot paths

on:
pull_request:
paths:
- ".github/workflows/xtajit64-apple-silicon-hotpaths.yml"
- "dlls/xtajit64/unixlib.c"
- "dlls/xtajit64/provider_tests/**"
push:
branches:
- perf/apple-silicon-context-batching
paths:
- ".github/workflows/xtajit64-apple-silicon-hotpaths.yml"
- "dlls/xtajit64/unixlib.c"
- "dlls/xtajit64/provider_tests/**"
workflow_dispatch:

permissions:
contents: read

concurrency:
group: xtajit64-apple-silicon-hotpaths-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
context-transfer:
name: Native arm64 context transfer
runs-on: macos-26
timeout-minutes: 30

steps:
- name: Check out source
uses: actions/checkout@v4

- name: Validate source contracts
shell: bash
run: |
set -euo pipefail
python3 dlls/xtajit64/provider_tests/check_apple_silicon_hotpaths.py \
dlls/xtajit64/unixlib.c
python3 -m py_compile \
dlls/xtajit64/provider_tests/check_apple_silicon_hotpaths.py
bash -n dlls/xtajit64/provider_tests/run_apple_silicon_hotpaths.sh
bash -n dlls/xtajit64/provider_tests/run_unixlib_concurrency.sh
git diff --check

- name: Benchmark pinned Unicorn on native Apple Silicon
shell: bash
run: |
set -euo pipefail
set -o pipefail
dlls/xtajit64/provider_tests/run_apple_silicon_hotpaths.sh \
"$RUNNER_TEMP/xtajit64-hotpaths" | tee "$RUNNER_TEMP/xtajit64-hotpaths.log"
grep -E '^(APPLE_SILICON_CPU|APPLE_SILICON_HOTPATH)' \
"$RUNNER_TEMP/xtajit64-hotpaths.log"
{
echo "## xtajit64 Apple Silicon context-transfer benchmark"
echo
echo '```text'
grep -E '^(APPLE_SILICON_CPU|APPLE_SILICON_HOTPATH)' \
"$RUNNER_TEMP/xtajit64-hotpaths.log"
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
64 changes: 64 additions & 0 deletions .github/workflows/xtajit64-apple-silicon-syscall-hotpath.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: xtajit64 Apple Silicon syscall hot path

on:
pull_request:
paths:
- ".github/workflows/xtajit64-apple-silicon-syscall-hotpath.yml"
- "dlls/xtajit64/**"
workflow_dispatch:

permissions:
contents: read

concurrency:
group: xtajit64-apple-silicon-syscall-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
syscall-register-transfer:
runs-on: macos-26
timeout-minutes: 30
steps:
- name: Check out source
uses: actions/checkout@v7

- name: Verify native Apple Silicon runner
shell: bash
run: |
set -euo pipefail
test "$(uname -s)" = Darwin
test "$(uname -m)" = arm64
if translated=$(/usr/sbin/sysctl -in sysctl.proc_translated 2>/dev/null); then
test "$translated" != 1
fi

- name: Verify syscall batching contracts
shell: bash
run: |
set -euo pipefail
python3 dlls/xtajit64/provider_tests/check_syscall_register_batching.py \
dlls/xtajit64/unixlib.c
Comment on lines +39 to +40

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add the missing syscall batching scripts before invoking them

On every pull request touching dlls/xtajit64/**, this step invokes check_syscall_register_batching.py, but the reviewed tree contains neither that file nor the subsequently invoked run_syscall_register_hotpath.sh (a repository-wide git grep finds only these YAML references). Python therefore exits with a missing-file error before the benchmark starts, making the new workflow fail for every matching PR; add both scripts or remove their invocations.

Useful? React with 👍 / 👎.

python3 -m py_compile \
dlls/xtajit64/provider_tests/check_syscall_register_batching.py
bash -n \
dlls/xtajit64/provider_tests/run_apple_silicon_hotpaths.sh \
dlls/xtajit64/provider_tests/run_syscall_register_hotpath.sh

- name: Build Unicorn and benchmark syscall preparation
shell: bash
run: |
set -euo pipefail
set -o pipefail
workspace="$RUNNER_TEMP/xtajit64-apple-silicon-syscall"
dlls/xtajit64/provider_tests/run_apple_silicon_hotpaths.sh \
"$workspace" | tee "$RUNNER_TEMP/context-hotpaths.log"
dlls/xtajit64/provider_tests/run_syscall_register_hotpath.sh \
"$workspace" | tee "$RUNNER_TEMP/syscall-hotpaths.log"
{
echo "## xtajit64 Apple Silicon syscall register benchmark"
echo
echo '```text'
grep -E '^(APPLE_SILICON_CPU|APPLE_SILICON_HOTPATH)' \
"$RUNNER_TEMP/syscall-hotpaths.log"
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
Loading
Loading