Skip to content

Commit 8a2f031

Browse files
committed
test: complete Wasmtime parity validation
1 parent 2dea285 commit 8a2f031

394 files changed

Lines changed: 46334 additions & 15572 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,18 +164,38 @@ 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: make -C toolchain commands
89-
- run: make -C toolchain cmd/duckdb
176+
- run: make -C toolchain cmd/duckdb cmd/vim
90177
- run: make -C toolchain codex
91178
- run: make -C toolchain/c pthread-conformance-wasm pthread-benchmark-wasm
92179
- run: node packages/runtime-core/scripts/copy-wasm-commands.mjs --require
180+
- name: Stage pinned xfstests and its WASM helper corpus
181+
run: make -C tests/xfstests helpers XFSTESTS_BUILD_NATIVE_COMMANDS=0
93182
- name: Use stable Rust for repository validation
94183
run: echo "RUSTUP_TOOLCHAIN=stable" >> "$GITHUB_ENV"
95184
# Browser support is retained in-tree but disabled during the unified
96185
# native sidecar reactor migration, so it must not gate native CI.
97186
- run: cargo check --workspace --exclude agentos-sidecar-browser --exclude agentos-native-sidecar-browser
98187
- run: cargo clippy --workspace --exclude agentos-sidecar-browser --exclude agentos-native-sidecar-browser --all-targets -- -D warnings
188+
- name: Build JavaScript workspace dependencies
189+
run: |
190+
pnpm exec turbo build \
191+
--only \
192+
--concurrency=4 \
193+
--filter='!@rivet-dev/agentos-website' \
194+
--filter='!@agentos-software/codex' \
195+
--filter='!@rivet-dev/agentos-browser' \
196+
--filter='!@rivet-dev/agentos-runtime-browser' \
197+
--filter='!@rivet-dev/agentos-example-browser-terminal' \
198+
--filter='!@rivet-dev/agentos-playground'
99199
- run: pnpm check-types
100200
- name: Build sidecars once for all TypeScript runtime suites
101201
run: cargo build -p agentos-sidecar -p agentos-native-sidecar

.github/workflows/ci.yml

Lines changed: 67 additions & 7 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,13 +76,15 @@ 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/check-rustfmt.test.mjs
7881
- run: node scripts/check-rustfmt.mjs
7982
- run: pnpm check-types
8083
- name: Run fast package unit tests
8184
run: |
8285
pnpm --parallel --aggregate-output \
8386
--filter '@rivet-dev/agentos-build-tools' \
87+
--filter '@rivet-dev/agentos-runtime-benchmarks' \
8488
--filter '@rivet-dev/agentos-toolchain' \
8589
--filter '@rivet-dev/agentos-runtime-sidecar' \
8690
test
@@ -121,24 +125,47 @@ jobs:
121125
workspaces: toolchain -> target
122126
key: wasm-commands-${{ hashFiles('toolchain/Cargo.lock') }}
123127
- run: pnpm install --frozen-lockfile --filter '@rivet-dev/agentos-runtime-core...'
124-
- run: make -C toolchain commands
128+
- name: Build the bounded PR command corpus
129+
if: github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'aggregate-ci')
130+
run: make -C toolchain pr-commands
131+
- name: Build the complete command corpus
132+
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'aggregate-ci')
133+
run: make -C toolchain commands
125134
# DuckDB and Vim are intentionally outside the default command set because
126135
# they are heavy builds, but the runtime/parity suites require their real
127136
# command artifacts.
128137
- name: Build required heavy integration commands
138+
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'aggregate-ci')
129139
run: make -C toolchain cmd/duckdb cmd/vim
140+
- name: Build the pinned Codex WASI artifacts required by the software suite
141+
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'aggregate-ci')
142+
run: make -C toolchain codex-required
130143
- name: Build mandatory threaded-WASM conformance fixtures
144+
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'aggregate-ci')
131145
run: make -C toolchain/c pthread-conformance-wasm pthread-benchmark-wasm
132146
- name: Stage native/WASM C parity fixtures
147+
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'aggregate-ci')
133148
run: make -C toolchain/c conformance-artifacts
134-
- run: node packages/runtime-core/scripts/copy-wasm-commands.mjs --require
149+
- name: Stage the bounded PR command corpus
150+
if: github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'aggregate-ci')
151+
run: node packages/runtime-core/scripts/copy-wasm-commands.mjs --require-coreutils
152+
- name: Stage the complete command corpus
153+
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'aggregate-ci')
154+
run: node packages/runtime-core/scripts/copy-wasm-commands.mjs --require
135155
- uses: actions/upload-artifact@v4
136156
with:
137157
name: wasm-commands
138158
path: packages/runtime-core/commands
139159
retention-days: 1
140160
if-no-files-found: error
141161
- uses: actions/upload-artifact@v4
162+
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'aggregate-ci')
163+
with:
164+
name: codex-wasi
165+
path: software/codex/wasm
166+
if-no-files-found: error
167+
- uses: actions/upload-artifact@v4
168+
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'aggregate-ci')
142169
with:
143170
name: wasm-thread-fixtures
144171
path: |
@@ -147,6 +174,7 @@ jobs:
147174
toolchain/c/build/exec_variants
148175
if-no-files-found: error
149176
- uses: actions/upload-artifact@v4
177+
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'aggregate-ci')
150178
with:
151179
name: wasm-c-parity-fixtures
152180
path: toolchain/c/build/conformance
@@ -329,7 +357,7 @@ jobs:
329357
required:
330358
name: CI / Required
331359
if: ${{ always() && (github.event_name != 'pull_request' || github.base_ref == 'main' || contains(github.event.pull_request.labels.*.name, 'aggregate-ci')) }}
332-
needs: [checks, wasm-commands, rust, core-pr, runtime-core-pr, actor-pr]
360+
needs: [checks, wasm-commands, rust, core-pr, runtime-core-pr, actor-pr, wasm-backend-matrix]
333361
runs-on: ubuntu-latest
334362
steps:
335363
- name: Require every PR gate
@@ -340,6 +368,8 @@ jobs:
340368
CORE_RESULT: ${{ needs.core-pr.result }}
341369
RUNTIME_CORE_RESULT: ${{ needs.runtime-core-pr.result }}
342370
ACTOR_RESULT: ${{ needs.actor-pr.result }}
371+
WASM_BACKEND_RESULT: ${{ needs.wasm-backend-matrix.result }}
372+
EXPECT_WASM_BACKEND_MATRIX: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'aggregate-ci') }}
343373
run: |
344374
for result in \
345375
"$CHECKS_RESULT" \
@@ -353,6 +383,10 @@ jobs:
353383
exit 1
354384
fi
355385
done
386+
if [ "$EXPECT_WASM_BACKEND_MATRIX" = true ] && [ "$WASM_BACKEND_RESULT" != success ]; then
387+
echo "required dual-backend CI job did not succeed: $WASM_BACKEND_RESULT" >&2
388+
exit 1
389+
fi
356390
357391
wasm-backend-matrix:
358392
name: "WASM backend (${{ matrix.backend }})"
@@ -368,25 +402,39 @@ jobs:
368402
AGENTOS_TEST_WASM_BACKEND: ${{ matrix.backend }}
369403
AGENTOS_E2E_NETWORK: '1'
370404
AGENT_OS_CLIENT_ALLOW_E2E_SKIPS: '0'
371-
AGENTOS_SIDECAR_BIN: ${{ github.workspace }}/target/release/agentos-native-sidecar
405+
AGENTOS_SIDECAR_BIN: ${{ github.workspace }}/target/release/agentos-sidecar
372406
AGENTOS_WASMTIME_WORKER_PATH: ${{ github.workspace }}/target/release/agentos-native-sidecar
373407
AGENTOS_WASM_COMMANDS_DIR: ${{ github.workspace }}/packages/runtime-core/commands
374408
AGENTOS_C_WASM_COMMANDS_DIR: ${{ github.workspace }}/toolchain/c/build/conformance
409+
XFSTESTS_ROOT: ${{ github.workspace }}/tests/xfstests/.work/xfstests
375410
steps:
376411
- uses: actions/checkout@v4
377412
- uses: pnpm/action-setup@v4
378413
- uses: actions/setup-node@v4
379414
with:
380-
node-version: 22
415+
node-version: 24
381416
- uses: dtolnay/rust-toolchain@stable
382417
- uses: Swatinem/rust-cache@v2
383418
with:
384419
key: wasm-backend-${{ matrix.backend }}
420+
- name: Materialize the pinned docs theme
421+
run: |
422+
rm -rf /tmp/docs-theme
423+
git clone https://github.com/rivet-dev/docs-theme.git /tmp/docs-theme
424+
git -C /tmp/docs-theme checkout 450c498555135098c6a927adfdf13458be9be22a
425+
rm -rf website/vendor/theme && mkdir -p website/vendor
426+
cp -r /tmp/docs-theme/packages/theme website/vendor/theme
385427
- run: pnpm install --frozen-lockfile
386428
- uses: actions/download-artifact@v4
387429
with:
388430
name: wasm-commands
389431
path: packages/runtime-core/commands
432+
- uses: actions/download-artifact@v4
433+
with:
434+
name: codex-wasi
435+
path: software/codex/wasm
436+
- name: Restore Codex WASI executable modes
437+
run: chmod 0755 software/codex/wasm/codex software/codex/wasm/codex-exec
390438
- uses: actions/download-artifact@v4
391439
with:
392440
name: wasm-thread-fixtures
@@ -395,22 +443,32 @@ jobs:
395443
with:
396444
name: wasm-c-parity-fixtures
397445
path: toolchain/c/build/conformance
446+
- name: Restore native C parity executable modes
447+
run: find toolchain/c/build/conformance/native -maxdepth 1 -type f -exec chmod 0755 '{}' +
398448
- name: Restore and package the validated command corpus
399449
run: |
400450
mkdir -p toolchain/target/wasm32-wasip1/release/commands
401451
cp -a packages/runtime-core/commands/. toolchain/target/wasm32-wasip1/release/commands/
402452
node packages/runtime-core/scripts/copy-wasm-commands.mjs --require
453+
pnpm --filter @agentos-software/manifest build
454+
pnpm --filter @rivet-dev/agentos-toolchain build
403455
pnpm --filter @agentos-software/coreutils build:runtime
404-
pnpm --filter '@agentos-software/common...' build
456+
pnpm --filter '@agentos-software/*' build
457+
- name: Stage pinned xfstests and its WASM helper corpus
458+
run: make -C tests/xfstests helpers XFSTESTS_BUILD_NATIVE_COMMANDS=0
405459
- name: Build the release sidecar and public test clients
406460
run: |
407-
cargo build --release -p agentos-native-sidecar
461+
cargo build --release -p agentos-sidecar -p agentos-native-sidecar
408462
pnpm --filter '@rivet-dev/agentos-runtime-core...' build
409463
pnpm --filter @rivet-dev/agentos-vm-test-harness build
464+
pnpm --filter @rivet-dev/agentos-test-harness build
410465
pnpm --filter @rivet-dev/agentos-core build
411466
pnpm --filter @rivet-dev/agentos build
412467
- name: Run all native sidecar tests through the selected VM backend
413468
run: cargo test --release -p agentos-native-sidecar --tests -- --test-threads=1
469+
- name: Run artifact-backed V8-WASM and Wasmtime software parity
470+
if: matrix.backend == 'wasmtime'
471+
run: cargo test --release -p agentos-native-sidecar --test wasm_software_parity -- --ignored --nocapture --test-threads=1
414472
- name: Run owned pthread libc conformance
415473
if: matrix.backend == 'wasmtime'
416474
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
@@ -424,6 +482,8 @@ jobs:
424482
run: cargo test -p agentos-client -- --test-threads=1
425483
- name: Run every registry software suite through the selected WASM backend
426484
run: pnpm exec turbo test --concurrency=1 --filter='@agentos-software/*'
485+
- name: Run every registry software nightly suite through the selected WASM backend
486+
run: pnpm exec turbo test:nightly --concurrency=1 --filter='@agentos-software/*'
427487
- name: Run deterministic actor, ACP, and agent-tool conformance
428488
run: pnpm --filter @rivet-dev/agentos test:e2e:run
429489
- name: Run mixed V8-JavaScript and Wasmtime resource-plateau smoke

0 commit comments

Comments
 (0)