Skip to content

Commit 64b4e1d

Browse files
committed
test: complete Wasmtime parity validation
1 parent 57aaa37 commit 64b4e1d

334 files changed

Lines changed: 41991 additions & 13074 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci-nightly.yml

Lines changed: 116 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
xfstests:
1010
name: "xfstests (${{ matrix.wasm_backend }}, ${{ matrix.storage_backend }})"
1111
runs-on: [self-hosted, agentos-builder]
12-
timeout-minutes: 360
12+
timeout-minutes: 420
1313
strategy:
1414
fail-fast: false
1515
matrix:
@@ -20,44 +20,124 @@ jobs:
2020
- uses: pnpm/action-setup@v4
2121
- uses: actions/setup-node@v4
2222
with:
23-
node-version: 22
23+
node-version: 24
2424
- uses: dtolnay/rust-toolchain@stable
2525
with:
2626
targets: wasm32-wasip1
27+
- name: Materialize the pinned docs theme
28+
run: |
29+
rm -rf /tmp/docs-theme
30+
git clone https://github.com/rivet-dev/docs-theme.git /tmp/docs-theme
31+
git -C /tmp/docs-theme checkout 450c498555135098c6a927adfdf13458be9be22a
32+
rm -rf website/vendor/theme && mkdir -p website/vendor
33+
cp -r /tmp/docs-theme/packages/theme website/vendor/theme
2734
- run: pnpm install --frozen-lockfile
2835
- name: Run the pinned filesystem conformance corpus
2936
run: make -C tests/xfstests run
3037
env:
3138
XFSTESTS_WASM_BACKENDS: ${{ matrix.wasm_backend }}
3239
XFSTESTS_BACKENDS: ${{ matrix.storage_backend }}
3340
XFSTESTS_CONCURRENCY: '2'
34-
- name: Run the 1,000-file multi-process directory stress gate
35-
if: matrix.storage_backend == 'chunked_local'
36-
run: |
37-
cargo test --release -p agentos-native-sidecar \
38-
--test xfstests_correctness \
39-
xfstests_wasi_dirstress_process_matrix -- \
40-
--ignored --exact --nocapture --test-threads=1
41-
env:
42-
AGENTOS_TEST_WASM_BACKEND: ${{ matrix.wasm_backend }}
43-
XFSTESTS_ROOT: ${{ github.workspace }}/tests/xfstests/.work/xfstests
44-
AGENTOS_V8_BRIDGE_PREBUILT_DIR: ${{ github.workspace }}/tests/xfstests/.cache/v8-bridge
45-
CARGO_TARGET_DIR: ${{ github.workspace }}/tests/xfstests/.cache/cargo-target
46-
CARGO_BUILD_JOBS: '1'
4741
- uses: actions/upload-artifact@v4
4842
if: always()
4943
with:
5044
name: xfstests-${{ matrix.wasm_backend }}-${{ matrix.storage_backend }}
5145
path: tests/xfstests/report
5246
if-no-files-found: warn
5347

48+
xfstests-endurance:
49+
name: "xfstests endurance (${{ matrix.wasm_backend }})"
50+
runs-on: [self-hosted, agentos-builder]
51+
timeout-minutes: 480
52+
strategy:
53+
fail-fast: false
54+
matrix:
55+
wasm_backend: [v8, wasmtime]
56+
env:
57+
AGENTOS_TEST_WASM_BACKEND: ${{ matrix.wasm_backend }}
58+
XFSTESTS_ROOT: ${{ github.workspace }}/tests/xfstests/.work/xfstests
59+
XFSTESTS_TEST_TIMEOUT_SECONDS: '3600'
60+
AGENTOS_V8_BRIDGE_PREBUILT_DIR: ${{ github.workspace }}/tests/xfstests/.cache/v8-bridge
61+
CARGO_TARGET_DIR: ${{ github.workspace }}/tests/xfstests/.cache/cargo-target
62+
CARGO_BUILD_JOBS: '1'
63+
steps:
64+
- uses: actions/checkout@v4
65+
- uses: pnpm/action-setup@v4
66+
- uses: actions/setup-node@v4
67+
with:
68+
node-version: 24
69+
- uses: dtolnay/rust-toolchain@stable
70+
with:
71+
targets: wasm32-wasip1
72+
- name: Materialize the pinned docs theme
73+
run: |
74+
rm -rf /tmp/docs-theme
75+
git clone https://github.com/rivet-dev/docs-theme.git /tmp/docs-theme
76+
git -C /tmp/docs-theme checkout 450c498555135098c6a927adfdf13458be9be22a
77+
rm -rf website/vendor/theme && mkdir -p website/vendor
78+
cp -r /tmp/docs-theme/packages/theme website/vendor/theme
79+
- run: pnpm install --frozen-lockfile
80+
- name: Stage the pinned corpus and helper binaries
81+
run: env -u CARGO_TARGET_DIR make -C tests/xfstests helpers
82+
- name: Build the V8 bridge used by the shared harness
83+
run: node packages/build-tools/scripts/build-v8-bridge.mjs --out-dir tests/xfstests/.cache/v8-bridge
84+
- name: Run the 1,000-file multi-process directory stress gate
85+
run: |
86+
cargo test --release -p agentos-native-sidecar \
87+
--test xfstests_correctness \
88+
xfstests_wasi_dirstress_process_matrix -- \
89+
--ignored --exact --nocapture --test-threads=1
90+
- name: Run the full parallel ENOSPC race
91+
run: |
92+
cargo test --release -p agentos-native-sidecar \
93+
--test xfstests_correctness \
94+
xfstests_wasi_parallel_enospc_endurance_probe -- \
95+
--ignored --exact --nocapture --test-threads=1
96+
- name: Run the full insert-range reproduction workload
97+
run: |
98+
cargo test --release -p agentos-native-sidecar \
99+
--test xfstests_correctness \
100+
xfstests_wasi_insert_range_endurance_probe -- \
101+
--ignored --exact --nocapture --test-threads=1
102+
- name: Run the full 162,000-iteration looptest workload
103+
run: |
104+
cargo test --release -p agentos-native-sidecar \
105+
--test xfstests_correctness \
106+
xfstests_wasi_looptest_endurance_probe -- \
107+
--ignored --exact --nocapture --test-threads=1
108+
- name: Run the full 10,000-file rewinddir workload
109+
run: |
110+
cargo test --release -p agentos-native-sidecar \
111+
--test xfstests_correctness \
112+
xfstests_wasi_rewinddir_endurance_probe -- \
113+
--ignored --exact --nocapture --test-threads=1
114+
- name: Run the full 10,000-file open-unlink workload
115+
run: |
116+
cargo test --release -p agentos-native-sidecar \
117+
--test xfstests_correctness \
118+
xfstests_wasi_open_unlink_endurance_probe -- \
119+
--ignored --exact --nocapture --test-threads=1
120+
- name: Run the full 4,000-file seekdir/getdents workload
121+
run: |
122+
cargo test --release -p agentos-native-sidecar \
123+
--test xfstests_correctness \
124+
xfstests_wasi_seekdir_endurance_probe -- \
125+
--ignored --exact --nocapture --test-threads=1
126+
- name: Run the full 5,000-file readdir/rename workload
127+
run: |
128+
cargo test --release -p agentos-native-sidecar \
129+
--test xfstests_correctness \
130+
xfstests_wasi_readdir_rename_endurance_probe -- \
131+
--ignored --exact --nocapture --test-threads=1
132+
54133
nightly:
55134
name: Nightly runtime validation
56135
runs-on: [self-hosted, agentos-builder]
57136
env:
58137
# Cargo validation and the shared sidecar build are explicit below.
59138
# Do not let TypeScript dependency builds compile a second Rust copy.
60139
AGENTOS_SKIP_NATIVE_META_BUILD: '1'
140+
XFSTESTS_ROOT: ${{ github.workspace }}/tests/xfstests/.work/xfstests
61141
steps:
62142
- uses: actions/checkout@v4
63143
- uses: pnpm/action-setup@v4
@@ -84,19 +164,39 @@ jobs:
84164
sudo apt-get update
85165
sudo apt-get install --yes cmake
86166
fi
167+
- name: Materialize the pinned docs theme
168+
run: |
169+
rm -rf /tmp/docs-theme
170+
git clone https://github.com/rivet-dev/docs-theme.git /tmp/docs-theme
171+
git -C /tmp/docs-theme checkout 450c498555135098c6a927adfdf13458be9be22a
172+
rm -rf website/vendor/theme && mkdir -p website/vendor
173+
cp -r /tmp/docs-theme/packages/theme website/vendor/theme
87174
- run: pnpm install --frozen-lockfile
88175
- run: node --test scripts/generate-secure-exec-mirror.test.mjs
89176
- run: make -C toolchain commands
90-
- run: make -C toolchain cmd/duckdb
177+
- run: make -C toolchain cmd/duckdb cmd/vim
91178
- run: make -C toolchain codex
92179
- run: make -C toolchain/c pthread-conformance-wasm pthread-benchmark-wasm
93180
- run: node packages/runtime-core/scripts/copy-wasm-commands.mjs --require
181+
- name: Stage pinned xfstests and its WASM helper corpus
182+
run: make -C tests/xfstests helpers XFSTESTS_BUILD_NATIVE_COMMANDS=0
94183
- name: Use stable Rust for repository validation
95184
run: echo "RUSTUP_TOOLCHAIN=stable" >> "$GITHUB_ENV"
96185
# Browser support is retained in-tree but disabled during the unified
97186
# native sidecar reactor migration, so it must not gate native CI.
98187
- run: cargo check --workspace --exclude agentos-sidecar-browser --exclude agentos-native-sidecar-browser
99188
- run: cargo clippy --workspace --exclude agentos-sidecar-browser --exclude agentos-native-sidecar-browser --all-targets -- -D warnings
189+
- name: Build JavaScript workspace dependencies
190+
run: |
191+
pnpm exec turbo build \
192+
--only \
193+
--concurrency=4 \
194+
--filter='!@rivet-dev/agentos-website' \
195+
--filter='!@agentos-software/codex' \
196+
--filter='!@rivet-dev/agentos-browser' \
197+
--filter='!@rivet-dev/agentos-runtime-browser' \
198+
--filter='!@rivet-dev/agentos-example-browser-terminal' \
199+
--filter='!@rivet-dev/agentos-playground'
100200
- run: pnpm check-types
101201
- name: Build sidecars once for all TypeScript runtime suites
102202
run: cargo build -p agentos-sidecar -p agentos-native-sidecar

.github/workflows/ci.yml

Lines changed: 65 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
--filter='!@agentos-software/codex' \
5151
--filter='!@rivet-dev/agentos-browser' \
5252
--filter='!@rivet-dev/agentos-runtime-browser' \
53+
--filter='!@rivet-dev/agentos-example-browser-terminal' \
5354
--filter='!@rivet-dev/agentos-playground'
5455
else
5556
npx turbo build \
@@ -58,6 +59,7 @@ jobs:
5859
--filter='!@agentos-software/codex' \
5960
--filter='!@rivet-dev/agentos-browser' \
6061
--filter='!@rivet-dev/agentos-runtime-browser' \
62+
--filter='!@rivet-dev/agentos-example-browser-terminal' \
6163
--filter='!@rivet-dev/agentos-playground'
6264
fi
6365
# The Codex adapter is ordinary TypeScript, while its executable is a
@@ -74,6 +76,7 @@ jobs:
7476
- run: node scripts/verify-fixed-versions.mjs
7577
- run: node --test scripts/check-layout.test.mjs
7678
- run: pnpm check-layout
79+
- run: node --test website/scripts/gen-registry.test.mjs
7780
- run: node --test scripts/generate-secure-exec-mirror.test.mjs
7881
- run: node --test scripts/check-rustfmt.test.mjs
7982
- run: node scripts/check-rustfmt.mjs
@@ -82,6 +85,7 @@ jobs:
8285
run: |
8386
pnpm --parallel --aggregate-output \
8487
--filter '@rivet-dev/agentos-build-tools' \
88+
--filter '@rivet-dev/agentos-runtime-benchmarks' \
8589
--filter '@rivet-dev/agentos-toolchain' \
8690
--filter '@rivet-dev/agentos-runtime-sidecar' \
8791
--filter 'secure-exec' \
@@ -123,24 +127,47 @@ jobs:
123127
workspaces: toolchain -> target
124128
key: wasm-commands-${{ hashFiles('toolchain/Cargo.lock') }}
125129
- run: pnpm install --frozen-lockfile --filter '@rivet-dev/agentos-runtime-core...'
126-
- run: make -C toolchain commands
130+
- name: Build the bounded PR command corpus
131+
if: github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'aggregate-ci')
132+
run: make -C toolchain pr-commands
133+
- name: Build the complete command corpus
134+
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'aggregate-ci')
135+
run: make -C toolchain commands
127136
# DuckDB and Vim are intentionally outside the default command set because
128137
# they are heavy builds, but the runtime/parity suites require their real
129138
# command artifacts.
130139
- name: Build required heavy integration commands
140+
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'aggregate-ci')
131141
run: make -C toolchain cmd/duckdb cmd/vim
142+
- name: Build the pinned Codex WASI artifacts required by the software suite
143+
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'aggregate-ci')
144+
run: make -C toolchain codex-required
132145
- name: Build mandatory threaded-WASM conformance fixtures
146+
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'aggregate-ci')
133147
run: make -C toolchain/c pthread-conformance-wasm pthread-benchmark-wasm
134148
- name: Stage native/WASM C parity fixtures
149+
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'aggregate-ci')
135150
run: make -C toolchain/c conformance-artifacts
136-
- run: node packages/runtime-core/scripts/copy-wasm-commands.mjs --require
151+
- name: Stage the bounded PR command corpus
152+
if: github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'aggregate-ci')
153+
run: node packages/runtime-core/scripts/copy-wasm-commands.mjs --require-coreutils
154+
- name: Stage the complete command corpus
155+
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'aggregate-ci')
156+
run: node packages/runtime-core/scripts/copy-wasm-commands.mjs --require
137157
- uses: actions/upload-artifact@v4
138158
with:
139159
name: wasm-commands
140160
path: packages/runtime-core/commands
141161
retention-days: 1
142162
if-no-files-found: error
143163
- uses: actions/upload-artifact@v4
164+
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'aggregate-ci')
165+
with:
166+
name: codex-wasi
167+
path: software/codex/wasm
168+
if-no-files-found: error
169+
- uses: actions/upload-artifact@v4
170+
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'aggregate-ci')
144171
with:
145172
name: wasm-thread-fixtures
146173
path: |
@@ -149,6 +176,7 @@ jobs:
149176
toolchain/c/build/exec_variants
150177
if-no-files-found: error
151178
- uses: actions/upload-artifact@v4
179+
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'aggregate-ci')
152180
with:
153181
name: wasm-c-parity-fixtures
154182
path: toolchain/c/build/conformance
@@ -331,7 +359,7 @@ jobs:
331359
required:
332360
name: CI / Required
333361
if: ${{ always() && (github.event_name != 'pull_request' || github.base_ref == 'main' || contains(github.event.pull_request.labels.*.name, 'aggregate-ci')) }}
334-
needs: [checks, wasm-commands, rust, core-pr, runtime-core-pr, actor-pr]
362+
needs: [checks, wasm-commands, rust, core-pr, runtime-core-pr, actor-pr, wasm-backend-matrix]
335363
runs-on: ubuntu-latest
336364
steps:
337365
- name: Require every PR gate
@@ -342,6 +370,8 @@ jobs:
342370
CORE_RESULT: ${{ needs.core-pr.result }}
343371
RUNTIME_CORE_RESULT: ${{ needs.runtime-core-pr.result }}
344372
ACTOR_RESULT: ${{ needs.actor-pr.result }}
373+
WASM_BACKEND_RESULT: ${{ needs.wasm-backend-matrix.result }}
374+
EXPECT_WASM_BACKEND_MATRIX: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'aggregate-ci') }}
345375
run: |
346376
for result in \
347377
"$CHECKS_RESULT" \
@@ -355,6 +385,10 @@ jobs:
355385
exit 1
356386
fi
357387
done
388+
if [ "$EXPECT_WASM_BACKEND_MATRIX" = true ] && [ "$WASM_BACKEND_RESULT" != success ]; then
389+
echo "required dual-backend CI job did not succeed: $WASM_BACKEND_RESULT" >&2
390+
exit 1
391+
fi
358392
359393
wasm-backend-matrix:
360394
name: "WASM backend (${{ matrix.backend }})"
@@ -370,25 +404,39 @@ jobs:
370404
AGENTOS_TEST_WASM_BACKEND: ${{ matrix.backend }}
371405
AGENTOS_E2E_NETWORK: '1'
372406
AGENT_OS_CLIENT_ALLOW_E2E_SKIPS: '0'
373-
AGENTOS_SIDECAR_BIN: ${{ github.workspace }}/target/release/agentos-native-sidecar
407+
AGENTOS_SIDECAR_BIN: ${{ github.workspace }}/target/release/agentos-sidecar
374408
AGENTOS_WASMTIME_WORKER_PATH: ${{ github.workspace }}/target/release/agentos-native-sidecar
375409
AGENTOS_WASM_COMMANDS_DIR: ${{ github.workspace }}/packages/runtime-core/commands
376410
AGENTOS_C_WASM_COMMANDS_DIR: ${{ github.workspace }}/toolchain/c/build/conformance
411+
XFSTESTS_ROOT: ${{ github.workspace }}/tests/xfstests/.work/xfstests
377412
steps:
378413
- uses: actions/checkout@v4
379414
- uses: pnpm/action-setup@v4
380415
- uses: actions/setup-node@v4
381416
with:
382-
node-version: 22
417+
node-version: 24
383418
- uses: dtolnay/rust-toolchain@stable
384419
- uses: Swatinem/rust-cache@v2
385420
with:
386421
key: wasm-backend-${{ matrix.backend }}
422+
- name: Materialize the pinned docs theme
423+
run: |
424+
rm -rf /tmp/docs-theme
425+
git clone https://github.com/rivet-dev/docs-theme.git /tmp/docs-theme
426+
git -C /tmp/docs-theme checkout 450c498555135098c6a927adfdf13458be9be22a
427+
rm -rf website/vendor/theme && mkdir -p website/vendor
428+
cp -r /tmp/docs-theme/packages/theme website/vendor/theme
387429
- run: pnpm install --frozen-lockfile
388430
- uses: actions/download-artifact@v4
389431
with:
390432
name: wasm-commands
391433
path: packages/runtime-core/commands
434+
- uses: actions/download-artifact@v4
435+
with:
436+
name: codex-wasi
437+
path: software/codex/wasm
438+
- name: Restore Codex WASI executable modes
439+
run: chmod 0755 software/codex/wasm/codex software/codex/wasm/codex-exec
392440
- uses: actions/download-artifact@v4
393441
with:
394442
name: wasm-thread-fixtures
@@ -397,22 +445,31 @@ jobs:
397445
with:
398446
name: wasm-c-parity-fixtures
399447
path: toolchain/c/build/conformance
448+
- name: Restore native C parity executable modes
449+
run: find toolchain/c/build/conformance/native -maxdepth 1 -type f -exec chmod 0755 '{}' +
400450
- name: Restore and package the validated command corpus
401451
run: |
402452
mkdir -p toolchain/target/wasm32-wasip1/release/commands
403453
cp -a packages/runtime-core/commands/. toolchain/target/wasm32-wasip1/release/commands/
404454
node packages/runtime-core/scripts/copy-wasm-commands.mjs --require
455+
pnpm --filter @agentos-software/manifest build
456+
pnpm --filter @rivet-dev/agentos-toolchain build
405457
pnpm --filter @agentos-software/coreutils build:runtime
406458
pnpm --filter '@agentos-software/common...' build
459+
- name: Stage pinned xfstests and its WASM helper corpus
460+
run: make -C tests/xfstests helpers XFSTESTS_BUILD_NATIVE_COMMANDS=0
407461
- name: Build the release sidecar and public test clients
408462
run: |
409-
cargo build --release -p agentos-native-sidecar
463+
cargo build --release -p agentos-sidecar -p agentos-native-sidecar
410464
pnpm --filter '@rivet-dev/agentos-runtime-core...' build
411465
pnpm --filter @rivet-dev/agentos-vm-test-harness build
412466
pnpm --filter @rivet-dev/agentos-core build
413467
pnpm --filter @rivet-dev/agentos build
414468
- name: Run all native sidecar tests through the selected VM backend
415469
run: cargo test --release -p agentos-native-sidecar --tests -- --test-threads=1
470+
- name: Run artifact-backed V8-WASM and Wasmtime software parity
471+
if: matrix.backend == 'wasmtime'
472+
run: cargo test --release -p agentos-native-sidecar --test wasm_software_parity -- --ignored --nocapture --test-threads=1
416473
- name: Run owned pthread libc conformance
417474
if: matrix.backend == 'wasmtime'
418475
run: cargo test --release -p agentos-native-sidecar --test wasmtime_safety owned_pthread_libc_mutex_cond_tls_join_detach_and_cancel_conform -- --ignored --exact --nocapture --test-threads=1
@@ -426,6 +483,8 @@ jobs:
426483
run: cargo test -p agentos-client -- --test-threads=1
427484
- name: Run every registry software suite through the selected WASM backend
428485
run: pnpm exec turbo test --concurrency=1 --filter='@agentos-software/*'
486+
- name: Run every registry software nightly suite through the selected WASM backend
487+
run: pnpm exec turbo test:nightly --concurrency=1 --filter='@agentos-software/*'
429488
- name: Run deterministic actor, ACP, and agent-tool conformance
430489
run: pnpm --filter @rivet-dev/agentos test:e2e:run
431490
- name: Run mixed V8-JavaScript and Wasmtime resource-plateau smoke

0 commit comments

Comments
 (0)