diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
deleted file mode 100644
index 96c891c..0000000
--- a/.github/workflows/ci.yml
+++ /dev/null
@@ -1,71 +0,0 @@
----
-name: CI
-
-on:
- push:
- branches: [main]
- workflow_dispatch:
-
-concurrency:
- group: ci-${{ github.ref }}
- cancel-in-progress: true
-
-env:
- DOCKER_BUILDKIT: 1
- COMPOSE_DOCKER_CLI_BUILD: 1
-
-jobs:
- ci:
- name: Game Mods CI
- runs-on: self-hosted
- timeout-minutes: 30
-
- steps:
- - name: Pre-checkout cleanup
- run: |
- for item in outputs target .git/index.lock; do
- if [ -d "$item" ] || [ -f "$item" ]; then
- docker run --rm -v "$(pwd):/workspace" busybox:1.36.1 sh -c \
- "rm -rf /workspace/$item" 2>/dev/null || \
- sudo rm -rf "$item" 2>/dev/null || true
- fi
- done
-
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Set UID/GID
- run: |
- echo "USER_ID=$(id -u)" >> $GITHUB_ENV
- echo "GROUP_ID=$(id -g)" >> $GITHUB_ENV
-
- # -- Formatting -------------------------------------------------------
- - name: Format check
- run: docker compose --profile ci run --rm rust-ci cargo fmt --all -- --check
-
- # -- Linting -----------------------------------------------------------
- - name: Clippy
- run: docker compose --profile ci run --rm rust-ci cargo clippy --all-targets -- -D warnings
-
- # -- Tests -------------------------------------------------------------
- - name: Test
- run: docker compose --profile ci run --rm rust-ci cargo test
-
- # -- Build -------------------------------------------------------------
- - name: Build
- run: docker compose --profile ci run --rm rust-ci cargo build --release
-
- # -- License / Advisory ------------------------------------------------
- - name: cargo-deny
- run: docker compose --profile ci run --rm rust-ci cargo deny check
-
- # -- Cleanup -----------------------------------------------------------
- - name: Fix Docker file ownership
- if: always()
- run: |
- for dir in target outputs; do
- if [ -d "$dir" ]; then
- docker run --rm -v "$(pwd)/$dir:/workspace" busybox:1.36.1 \
- chown -Rh "$(id -u):$(id -g)" /workspace 2>/dev/null || true
- fi
- done
diff --git a/.github/workflows/main-ci.yml b/.github/workflows/main-ci.yml
index 588539f..940a302 100644
--- a/.github/workflows/main-ci.yml
+++ b/.github/workflows/main-ci.yml
@@ -25,13 +25,9 @@ jobs:
steps:
- name: Pre-checkout cleanup
run: |
- for item in outputs target .git/index.lock; do
- if [ -d "$item" ] || [ -f "$item" ]; then
- docker run --rm -v "$(pwd):/workspace" busybox:1.36.1 sh -c \
- "rm -rf /workspace/$item" 2>/dev/null || \
- sudo rm -rf "$item" 2>/dev/null || true
- fi
- done
+ docker run --rm -v "$(pwd):/workspace" busybox:1.36.1 sh -c \
+ "rm -rf /workspace/outputs /workspace/.git/index.lock" 2>/dev/null || \
+ sudo rm -rf outputs .git/index.lock 2>/dev/null || true
- name: Checkout
uses: actions/checkout@v4
@@ -54,7 +50,7 @@ jobs:
# -- Tests -------------------------------------------------------------
- name: Test
- run: docker compose --profile ci run --rm rust-ci cargo test
+ run: docker compose --profile ci run --rm rust-ci cargo test -- --test-threads=4
# -- Build -------------------------------------------------------------
- name: Build
diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml
index ab3e8bb..807440f 100644
--- a/.github/workflows/pr-validation.yml
+++ b/.github/workflows/pr-validation.yml
@@ -40,13 +40,9 @@ jobs:
steps:
- name: Pre-checkout cleanup
run: |
- for item in outputs target .git/index.lock; do
- if [ -d "$item" ] || [ -f "$item" ]; then
- docker run --rm -v "$(pwd):/workspace" busybox:1.36.1 sh -c \
- "rm -rf /workspace/$item" 2>/dev/null || \
- sudo rm -rf "$item" 2>/dev/null || true
- fi
- done
+ docker run --rm -v "$(pwd):/workspace" busybox:1.36.1 sh -c \
+ "rm -rf /workspace/outputs /workspace/.git/index.lock" 2>/dev/null || \
+ sudo rm -rf outputs .git/index.lock 2>/dev/null || true
- name: Checkout
uses: actions/checkout@v4
@@ -71,7 +67,7 @@ jobs:
# -- Tests -------------------------------------------------------------
- name: Test
- run: docker compose --profile ci run --rm rust-ci cargo test
+ run: docker compose --profile ci run --rm rust-ci cargo test -- --test-threads=4
# -- Build -------------------------------------------------------------
- name: Build
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 81309a7..d3879e1 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -13,6 +13,7 @@ repos:
args: [--unsafe]
- id: check-added-large-files
args: [--maxkb=1000]
+ exclude: '^Cargo\.lock$'
- id: check-json
- id: pretty-format-json
args: [--autofix, --no-sort-keys]
@@ -35,19 +36,19 @@ repos:
types: [shell]
args: [-x]
- # Rust formatting and linting (containerized)
+ # Rust formatting and linting (local, no Docker rebuild)
- repo: local
hooks:
- id: rust-fmt
name: Rust format check
- entry: docker compose --profile ci run --rm rust-ci cargo fmt --all -- --check
+ entry: cargo fmt --all -- --check
language: system
files: '\.rs$'
pass_filenames: false
- id: rust-clippy
name: Rust clippy lint
- entry: docker compose --profile ci run --rm rust-ci cargo clippy --all-targets -- -D warnings
+ entry: cargo clippy --all-targets -- -D warnings
language: system
files: '\.rs$'
pass_filenames: false
diff --git a/Cargo.toml b/Cargo.toml
index ff4667f..7e574eb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -53,6 +53,7 @@ authors = ["AndrewAltimit"]
[workspace.dependencies]
# Serialization
serde = { version = "1.0", features = ["derive"] }
+serde_json = "1.0"
bitcode = { version = "0.6", features = ["serde"] }
bincode = "1.3" # Legacy: only used in itk-net (laminar dependency)
@@ -89,6 +90,17 @@ parking_lot = "0.12"
# Vulkan
ash = { version = "0.38", features = ["loaded"] }
+# CLI
+clap = { version = "4", features = ["derive"] }
+
+# GUI
+egui = "0.28"
+egui-wgpu = "0.28"
+egui-winit = "0.28"
+wgpu = "0.20"
+winit = "0.29"
+once_cell = "1.19"
+
# Hooking
retour = { version = "0.3", features = ["static-detour"] }
@@ -125,6 +137,8 @@ clone_on_ref_ptr = "warn"
dbg_macro = "deny"
todo = "deny"
unimplemented = "deny"
+undocumented_unsafe_blocks = "warn"
+missing_safety_doc = "warn"
[workspace.lints.rust]
unsafe_op_in_unsafe_fn = "warn"
diff --git a/core/itk-ipc/src/unix_impl.rs b/core/itk-ipc/src/unix_impl.rs
index a8c9a24..93601b9 100644
--- a/core/itk-ipc/src/unix_impl.rs
+++ b/core/itk-ipc/src/unix_impl.rs
@@ -56,13 +56,16 @@ fn remove_socket_file(path: &str) {
/// Non-blocking receive helper that keeps the lock held while consuming data.
///
-/// This prevents race conditions where another thread could consume data between
-/// peeking and actually reading.
+/// Uses a single MSG_PEEK to check for the header, then a single blocking recv
+/// to consume the full message. This avoids the race condition where data could
+/// arrive between multiple peek operations.
fn try_recv_with_fd(fd: std::os::unix::io::RawFd) -> Result