Skip to content

Commit

Permalink
Add JIT support to Windows (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkeeter authored Apr 13, 2024
1 parent 31cf2b0 commit 10263c6
Show file tree
Hide file tree
Showing 9 changed files with 216 additions and 89 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
matrix:
target: [
"aarch64-apple-darwin",
"aarch64-pc-windows-msvc",
"aarch64-unknown-linux-gnu",
]
runs-on: macos-14
Expand All @@ -25,4 +26,3 @@ jobs:
run: rustup target add ${{ matrix.target }}
- name: Check
run: cargo check --target=${{ matrix.target }} --all-targets --verbose

2 changes: 1 addition & 1 deletion .github/workflows/check-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
matrix:
target: [
"x86_64-unknown-linux-gnu",
"x86_64-pc-windows-msvc",
]
runs-on: ubuntu-latest
steps:
Expand All @@ -24,4 +25,3 @@ jobs:
run: rustup target add ${{ matrix.target }}
- name: Check
run: cargo check --target=${{ matrix.target }} --all-targets --verbose

3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ jobs:
test:
strategy:
matrix:
os: ["ubuntu-latest", "macos-14"]
os: ["ubuntu-latest", "macos-14", "windows-latest"]
runs-on: ${{ matrix.os }}
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
actually guarantee manifold models
(see [this scale-invariant adversarial model](https://www.mattkeeter.com/blog/2023-04-23-adversarial/)),
so the extra complexity isn't worth it.
- Added Windows support (including JIT)

# 0.2.4
The highlight of this release is a refactoring of how shapes are handled in Rhai
Expand Down
78 changes: 54 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 33 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,44 @@ two demo applications:
These are deliberately not published to [https://crates.io](crates.io), because
they're demo applications and not complete end-user tools.

## Platforms
At the moment, the JIT supports three platforms:

- `aarch64-apple-darwin`
- `x86_64-unknown-linux-*`
- `aarch64-unknown-linux-*` (not tested in CI)

## Support matrix
At the moment, Fidget supports a limited number of platforms:

| Platform | JIT support | CI | Support |
|-----------------------------|-------------|------------|-----------|
| `aarch64-apple-darwin` | Yes | ✅ Tested | ⭐️ Tier 0 |
| `x86_64-unknown-linux-gnu` | Yes | ✅ Tested | 🥇 Tier 1 |
| `x86_64-pc-windows-msvc` | Yes | ✅ Tested | 🥈 Tier 2 |
| `aarch64-unknown-linux-gnu` | Yes | ⚠️ Checked | 🥇 Tier 1 |
| `aarch64-pc-windows-msvc` | Yes | ⚠️ Checked | 🥉 Tier 3 |
| `wasm32-unknown-unknown` | No | ⚠️ Checked | 🥇 Tier 1 |

### Explanation of keys
| CI | Description |
|------------|-------------------------------------------|
| ✅ Tested | `cargo test` is run for the given target |
| ⚠️ Checked | `cargo check` is run for the given target |

| Tier | Description |
|-----------|--------------------------------------------------------------------------------|
| ⭐️ Tier 0 | A maintainer uses this platform as their daily driver |
| 🥇 Tier 1 | A maintainer has access to this platform |
| 🥈 Tier 2 | A maintainer does not have access to this platform, but it is tested in CI |
| 🥉 Tier 3 | A maintainer does not have access to this platform, and it is not tested in CI |

Support tiers represent whether maintainers will be able to help with
platform-specific bugs; for example, if you discover an
`aarch64-pc-windows-msvc`-specific issue, expect to do most of the heavy lifting
yourself.

### CPU requirements
`aarch64` platforms require NEON instructions and `x86_64` platforms require
AVX2 support; both of these extensions are nearly a decade old and should be
widespread.

Disabling the `jit` feature allows for cross-platform rendering, using an
interpreter rather than JIT compilation.

`x86_64-pc-windows-*` and `aarch64-pc-windows-*` _may_ be close to working (with
only minor tweaks required); the author does not have a Windows machine on which
to test.
interpreter rather than JIT compilation. This is mandatory for the
`wasm32-unknown-unknown` target, which cannot generate "native" code.

## Similar projects
Fidget overlaps with various projects in the implicit modeling space:
Expand Down
3 changes: 3 additions & 0 deletions fidget/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ rhai = { version = "1.17", optional = true, features = ["sync"] }
# Meshing
crossbeam-deque = { version = "0.8", optional = true }

[target.'cfg(target_os = "windows")'.dependencies]
windows = { version = "0.54.0", features = ["Win32_Foundation", "Win32_System_Memory"] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.2", features = ["js"] }

Expand Down
Loading

0 comments on commit 10263c6

Please sign in to comment.