Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
842e053
Tweaks to printing; ignore section tests.
dvanhorn Apr 8, 2026
b72bff1
Remove Racket package caching which seems to cache a86, which we defi…
dvanhorn Apr 9, 2026
05e7161
Add LLVM-based in-process JIT prototype
dvanhorn Apr 9, 2026
2d31f42
Use clang-setup in docs.yml.
dvanhorn Apr 9, 2026
3fffc98
Set clang/LLVM version to 22 in actions.
dvanhorn Apr 9, 2026
0da844d
Try different LLVM setup action.
dvanhorn Apr 9, 2026
0e55955
But set LLVM version to 22, duh.
dvanhorn Apr 9, 2026
539dde8
Fix issue with defined symbols.
dvanhorn Apr 9, 2026
7894cb0
Add ability to link in object files.
dvanhorn Apr 9, 2026
a6d45d4
Add current objects to this tracker.
dvanhorn Apr 9, 2026
643c4f4
WIP: jit based asm-interp.
dvanhorn Apr 9, 2026
6263ccc
Add set_global API; use in interp to mutate runtime globals
dvanhorn Apr 9, 2026
4cddb67
Support error handler call from compiled code; recover from errors
dvanhorn Apr 9, 2026
2ea724d
Add heap support and call entry point with heap argument.
dvanhorn Apr 9, 2026
f2736ab
Keep tracker alive until next run of interpreter.
dvanhorn Apr 9, 2026
db7f3a5
Use the bug-fix branch of langs for now.
dvanhorn Apr 10, 2026
900e16b
Path resolution for object files.
dvanhorn Apr 10, 2026
8513ec0
Remove libssl dependency in push action.
dvanhorn Apr 10, 2026
1a96e43
Run tests in parallel.
dvanhorn Apr 10, 2026
9ae9622
Restore libssl dependency, needed for run-xvfb I guess.
dvanhorn Apr 10, 2026
c3bd29c
OK, we actually need xvfb-run because of stepper.rkt.
dvanhorn Apr 10, 2026
045c9dc
Parallel test and run-xvfb don't seem to play well together; remove s…
dvanhorn Apr 10, 2026
58318d4
Better error reporting mechanism.
dvanhorn Apr 11, 2026
9fbaf20
Overhaul of new JIT system.
dvanhorn Apr 14, 2026
5f4dea5
Use shared support JITDylib instead of per-program process generators.
dvanhorn Apr 21, 2026
f66550f
Add mutex and locking around a86_jit_load, a86_program_call, a86_prog…
dvanhorn Apr 21, 2026
8a4659b
Try to stop deadlock.
dvanhorn Apr 21, 2026
72e80f5
Bug fix in native.
dvanhorn Apr 21, 2026
9deaace
Redesign to minimize ORC shared re-use.
dvanhorn Apr 21, 2026
89bd3bb
Remove mutex.
dvanhorn Apr 21, 2026
9b71de7
Try will simple unload.
dvanhorn Apr 21, 2026
128b22a
Change execution model so the actual ORC program namespace is per cal…
dvanhorn Apr 21, 2026
54ddf81
Another redesign.
dvanhorn Apr 21, 2026
225af58
Another attempt.
dvanhorn Apr 21, 2026
2a6a3c8
Don't pool; try again to solve symbol issue.
dvanhorn Apr 21, 2026
306478e
Try a heavy-handed fix.
dvanhorn May 7, 2026
d214b84
Revert "Try a heavy-handed fix."
dvanhorn May 7, 2026
628bc11
Another try and eliminating all sharing so the test suite passes.
dvanhorn May 7, 2026
e93a745
Add JIT tracing and keep CI matrix running
dvanhorn May 7, 2026
764685b
More debugging.
dvanhorn May 7, 2026
bd2384b
Add native JIT trace logging
dvanhorn May 7, 2026
c03f2af
Fix extern binding name marshalling
dvanhorn May 7, 2026
5251a06
Rerun failing CI jobs with JIT trace
dvanhorn May 7, 2026
f412734
More debugging attempts.
dvanhorn May 7, 2026
598819e
Own extern bindings for loaded programs
dvanhorn May 7, 2026
acfca4f
Isolate externs in per-program support dylibs
dvanhorn May 7, 2026
468ce30
Use parallel extern arrays in JIT FFI
dvanhorn May 7, 2026
2d41613
Add focused CI jobs for remaining runtime failures
dvanhorn May 7, 2026
70f3dfc
Trace host extern callback calls
dvanhorn May 7, 2026
0fc79d9
Use plain structs for JIT extern bindings
dvanhorn May 7, 2026
c231a21
Package prebuilt macOS JIT library
dvanhorn May 7, 2026
921e88c
Run stage-prebuilt only as a script
dvanhorn May 7, 2026
fd97c5f
Use supported Intel macOS runner
dvanhorn May 8, 2026
0708b6f
Statically link LLVM into macOS prebuilt JIT
dvanhorn May 8, 2026
fceae21
Add workflow to build macOS prebuilt binary
dvanhorn May 8, 2026
e52addb
Open PRs for rebuilt macOS prebuilt dylib
dvanhorn May 8, 2026
8b044df
Run macOS prebuilt builder on push
dvanhorn May 8, 2026
b6b377c
Add workflow to build Linux prebuilt binary
dvanhorn May 8, 2026
ed052e0
Update Linux x86_64 prebuilt JIT library (#47)
github-actions[bot] May 8, 2026
8d1a005
Don't bother installing LLVM, just use pre-built JIT library; remove …
dvanhorn May 8, 2026
7b6f0e6
Merge branch 'next' of github.com:cmsc430/a86 into next
dvanhorn May 8, 2026
737c5a2
Statically link LLVM into Linux prebuilt JIT
dvanhorn May 8, 2026
96794f0
Update Linux x86_64 prebuilt JIT library (#49)
github-actions[bot] May 8, 2026
679078f
Link Linux prebuilt JIT with static LLVM system libs
dvanhorn May 8, 2026
ade8f9b
Merge branch 'next' of github.com:cmsc430/a86 into next
dvanhorn May 8, 2026
e3785be
Update Linux x86_64 prebuilt JIT library (#50)
github-actions[bot] May 8, 2026
e4d9651
Update workflow Racket versions
dvanhorn May 8, 2026
2a3fc74
A couple of READMEs.
dvanhorn May 8, 2026
801b5a5
Retain extern callback trampolines across loads
dvanhorn May 8, 2026
7961cb0
Add no-unload debug mode for JIT
dvanhorn May 8, 2026
958539a
Default a86 loads to one-shot JITs
dvanhorn May 9, 2026
46e3a7c
Make default a86 calls lazy and one-shot
dvanhorn May 9, 2026
d6f617c
Revert "Make default a86 calls lazy and one-shot"
dvanhorn May 9, 2026
89ccb2a
Close owned JITs without explicit unload
dvanhorn May 9, 2026
fe38692
Use raw memory for transient JIT FFI strings
dvanhorn May 9, 2026
77278b0
Run langs CI tests serially
dvanhorn May 9, 2026
4476e13
Run a86 CI tests serially
dvanhorn May 9, 2026
2b3d635
Test against langs package in same branch.
dvanhorn May 9, 2026
4645f5c
Merge branch 'main' into next
dvanhorn May 27, 2026
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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
a86/native/prebuilt/** binary
a86/native/prebuilt/** -merge
65 changes: 65 additions & 0 deletions .github/workflows/build-prebuilt-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build Prebuilt Linux Binary
on: [push, workflow_dispatch]

permissions:
contents: write
pull-requests: write

jobs:
build-prebuilt-linux:
runs-on: ubuntu-22.04
name: Build Linux prebuilt / Racket 8.18

steps:
- name: Checkout
uses: actions/checkout@main

- name: Install Racket
uses: Bogdanp/setup-racket@v1.15
with:
architecture: x64
distribution: full
variant: CS
version: "8.18"

- name: Install LLVM
uses: ZhongRuoyu/setup-llvm@v0
with:
llvm-version: 22

- name: Install native build dependencies
run: |
sudo apt update
sudo apt install -y libxml2-dev zlib1g-dev libzstd-dev

- name: Build native JIT library
run: |
make -C a86/native clean all LLVM_CONFIG=llvm-config

- name: Stage packaged prebuilt library
run: |
racket a86/native/stage-prebuilt.rkt

- name: Check packaged shared object linkage
run: |
ldd a86/native/prebuilt/unix/x86_64/liba86_jit.so

- name: Upload packaged shared object
uses: actions/upload-artifact@v4
with:
name: a86-prebuilt-linux-x86_64
path: a86/native/prebuilt/unix/x86_64/liba86_jit.so
if-no-files-found: error

- name: Create pull request for updated shared object
uses: peter-evans/create-pull-request@v8
with:
branch: update-prebuilt-linux-x86_64
delete-branch: true
commit-message: Update Linux x86_64 prebuilt JIT library
title: Update Linux x86_64 prebuilt JIT library
body: |
Rebuilds `a86/native/prebuilt/unix/x86_64/liba86_jit.so`
using the `Build Prebuilt Linux Binary` workflow on GitHub Actions.
add-paths: |
a86/native/prebuilt/unix/x86_64/liba86_jit.so
61 changes: 61 additions & 0 deletions .github/workflows/build-prebuilt-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build Prebuilt macOS Binary
on: [push, workflow_dispatch]

permissions:
contents: write
pull-requests: write

jobs:
build-prebuilt-macos:
runs-on: macos-26-intel
name: Build macOS prebuilt / Racket 8.18

steps:
- name: Checkout
uses: actions/checkout@main

- name: Install Racket
uses: Bogdanp/setup-racket@v1.15
with:
architecture: 'x64'
distribution: 'full'
variant: 'CS'
version: '8.18'

- name: Install native build dependencies
run: |
brew install llvm@22 zstd z3

- name: Build native JIT library
run: |
export PATH="/usr/local/opt/llvm@22/bin:$PATH"
make -C a86/native clean all LLVM_CONFIG=llvm-config

- name: Stage packaged prebuilt library
run: |
export PATH="/usr/local/opt/llvm@22/bin:$PATH"
racket a86/native/stage-prebuilt.rkt

- name: Check packaged dylib linkage
run: |
otool -L a86/native/prebuilt/macosx/x86_64/liba86_jit.dylib

- name: Upload packaged dylib
uses: actions/upload-artifact@v4
with:
name: a86-prebuilt-macos-x86_64
path: a86/native/prebuilt/macosx/x86_64/liba86_jit.dylib
if-no-files-found: error

- name: Create pull request for updated dylib
uses: peter-evans/create-pull-request@v8
with:
branch: update-prebuilt-macos-x86_64
delete-branch: true
commit-message: Update macOS x86_64 prebuilt JIT library
title: Update macOS x86_64 prebuilt JIT library
body: |
Rebuilds `a86/native/prebuilt/macosx/x86_64/liba86_jit.dylib`
using the `Build Prebuilt macOS Binary` workflow on GitHub Actions.
add-paths: |
a86/native/prebuilt/macosx/x86_64/liba86_jit.dylib
9 changes: 5 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ jobs:
uses: actions/checkout@main

- name: Install Racket
uses: Bogdanp/setup-racket@v1.14
uses: Bogdanp/setup-racket@v1.15
with:
architecture: 'x64'
distribution: 'full'
variant: ${{ matrix.racket-variant }}
version: ${{ matrix.racket-version }}

- name: Install clang
run: |
sudo apt install -y clang libssl-dev
- name: Install LLVM
uses: ZhongRuoyu/setup-llvm@v0
with:
llvm-version: 22

- name: Install pandoc
run: |
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/prebuilt-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Test Prebuilt macOS Binary
on: [push, workflow_dispatch]

jobs:
test-prebuilt-macos:
runs-on: macos-26-intel
name: macOS prebuilt / Racket 8.18

steps:
- name: Checkout
uses: actions/checkout@main

- name: Install Racket
uses: Bogdanp/setup-racket@v1.15
with:
architecture: 'x64'
distribution: 'full'
variant: 'CS'
version: '8.18'

- name: Install a86 package
run: |
raco pkg install --no-docs ../a86/

- name: Verify prebuilt library was installed
run: |
test -f a86/native/prebuilt/macosx/x86_64/liba86_jit.dylib
test -f a86/native/lib/liba86_jit.dylib

- name: Run tests
run: |
raco test -p a86
34 changes: 14 additions & 20 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ on: [push, workflow_dispatch]
jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-24.04]
racket-variant: ['CS']
racket-version: ['8.6', '8.10', '8.14', '8.18', 'stable', 'current']
racket-version: ['8.6', '8.10', '8.14', '8.18', '9.1', 'stable', 'current']
runs-on: ${{ matrix.os }}
name: OS ${{ matrix.os }} / Racket ${{ matrix.racket-version }}

Expand All @@ -17,42 +18,35 @@ jobs:
uses: actions/checkout@main

- name: Install Racket
uses: Bogdanp/setup-racket@v1.14
uses: Bogdanp/setup-racket@v1.15
with:
architecture: 'x64'
distribution: 'full'
variant: ${{ matrix.racket-variant }}
version: ${{ matrix.racket-version }}

- name: Install clang
run: |
sudo apt install -y clang libssl-dev

- name: Version info
run: |
clang --version
gcc --version

- name: Cache Racket packages
uses: actions/cache@v4
with:
path: |
~/.racket
~/.cache/racket
~/.local/share/racket
~/Library/Caches/Racket
key: racket-${{ matrix.racket-variant }}-${{ matrix.racket-version }}-${{ matrix.os }}

- name: Install a86 package
run: |
raco pkg install --no-docs ../a86/

- name: Install langs package
run: |
# This *should* use the locally installed a86
raco pkg install --auto 'https://github.com/cmsc430/langs.git?#main'
git clone --branch "${{ github.ref_name }}" --single-branch https://github.com/cmsc430/langs.git ../langs
raco pkg install --auto --no-docs ../langs/

- name: Install libssl
run: |
sudo apt install -y libssl-dev

- name: Run a86 tests
run: |
raco test -p a86

- name: Run tests
- name: Run langs tests
run: |
xvfb-run raco test -p a86
xvfb-run raco test -p langs
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ Mkfile.old
dkms.conf

# debug information files
*.dwo
*.dwo
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# a86

`a86` is a Racket package for composing, printing, interpreting, and running x86-64 assembly programs from Racket.

## Installation

Install from GitHub with:

```bash
raco pkg install https://github.com/cmsc430/a86.git
```

## Notes

This package includes prebuilt native JIT libraries for Linux and macOS on `x86_64`, so most installs do not need a local native build toolchain.

Documentation is published at:

https://cmsc430.github.io/a86/
32 changes: 32 additions & 0 deletions a86/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Developer Notes

This directory contains the `a86` collection, including the native JIT support under `native/`.

## Building Native Libraries Locally

Local native builds are only needed when you want to rebuild or restage the JIT libraries instead of using the packaged prebuilt artifacts.

You will need:

- `x86_64` Racket
- `make` or `gmake`
- a C++17 compiler (`clang++` by default in `native/Makefile`)
- LLVM with `llvm-config` available on `PATH`

The GitHub workflows currently build against LLVM 22.

From [`a86/native`](/Users/dvanhorn/git/a86/a86/native), run:

```bash
make
```

This produces the shared library in `a86/native/lib/`.

If you want to refresh the packaged prebuilt layout after building, run:

```bash
racket a86/native/stage-prebuilt.rkt
```

At package install time, `a86/pre-install.rkt` first tries to copy a matching prebuilt library and only falls back to `make` when no packaged binary is available for the target OS and architecture.
9 changes: 0 additions & 9 deletions a86/check-x86.rkt

This file was deleted.

6 changes: 4 additions & 2 deletions a86/info.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
(define deps (list "base" "rackunit" "redex-lib" "redex-gui-lib"))
(define scribblings '(("scribblings/a86.scrbl")))
(define test-omit-paths '("scribblings/"
"test/expressions.rkt"))
(define pre-install-collection "check-x86.rkt")
"test/expressions.rkt"
"test/sections.rkt"
"stepper.rkt"))
(define pre-install-collection "pre-install.rkt")
Loading
Loading