Skip to content

Commit 83b9470

Browse files
Stress sustained native tasks, memory, cancellation and process cleanup
1 parent c084620 commit 83b9470

5 files changed

Lines changed: 374 additions & 0 deletions

File tree

‎.github/workflows/native.yml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ jobs:
3030
- run: cargo +1.95.0 build -p shadowcode-desktop --locked
3131
- name: Exercise the native CLI without a display
3232
run: node scripts/test-native-cli.mjs
33+
- name: Stress repeated native tasks, cancellation, output and cleanup
34+
run: node scripts/test-native-stress.mjs
35+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
36+
if: always()
37+
with:
38+
name: native-stress-diagnostics
39+
path: artifacts/native-stress
3340
- name: Exercise the native terminal through a real PTY
3441
run: node scripts/test-native-tui.mjs
3542
- name: Exercise the native MCP server without a display

‎CHANGELOG.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## 0.20.0 — native development (unreleased)
44

5+
- CI now exercises 200 native tasks, stalled-provider cancellations and output
6+
floods while checking memory, descriptors, child cleanup and history integrity.
7+
58
- Native development: reviewed CLI and desktop rescue for missing worktrees restores retained
69
commits into a new checkout while preserving the original branch, index and
710
registration; missing uncommitted files are not reconstructed.

‎docs/NATIVE_MIGRATION.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ Implemented foundation:
123123
use scoped shell/start and stop approvals, command hooks, bounded status/log
124124
reads and durable task attribution. These project processes intentionally
125125
survive coding-task completion or cancellation until explicitly stopped.
126+
- Sustained native-engine verification covers 200 tasks across four projects,
127+
stalled-provider cancellation, repeated subprocess output floods, sampled
128+
memory/descriptors, process cleanup and persisted history after restart.
129+
Desktop memory, long individual conversations and larger repository stress
130+
remain separate checks.
126131
- A persisted native task loop, per-workspace FIFO follow-ups, four concurrent
127132
workspaces, scoped approvals, cancellation that waits for cleanup, restart
128133
recovery, and atomic completion/usage/event commits. Continuation and branching

‎docs/NATIVE_VERIFICATION.md‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,32 @@ The [plugin guide](NATIVE_PLUGINS.md) documents the supported schema, example
251251
bundle, limits, separate executable activation and partial-install recovery.
252252
Legacy Python bundles remain on disk and are explicitly reported for conversion.
253253

254+
## Sustained native-engine stress
255+
256+
`node scripts/test-native-stress.mjs` runs the native executable without a display
257+
against a disposable profile and scripted compatible provider. Fifty batches
258+
submit one task to each of four projects: **200 completed tasks / 405 provider
259+
requests**, including actual bounded reads of 105 KB files and roughly 32 KB
260+
assistant answers. Five deliberately stalled provider requests are cancelled.
261+
Ten manual subprocesses each produce 1 MiB of output; each must exit successfully
262+
and report truncated, nonempty bounded output.
263+
264+
The final local run sampled engine RSS at 83,464–85,352 KiB, with 84,908 KiB after
265+
the subprocess phase: 828 KiB above the 40-task warm-up sample. All samples had
266+
14 descriptors and 21 threads; no engine-owned child processes remained at the
267+
sample points. SQLite integrity passes, exactly 200 completed and five cancelled
268+
jobs persist with no active jobs, and an early job remains readable after clean
269+
shutdown and reopening the profile. CI runs the same probe and uploads its JSON
270+
measurements or failure diagnostics under `native-stress-diagnostics`.
271+
272+
The regression allows less than 64 MiB RSS growth after warm-up, sampled RSS below
273+
384 MiB, and at most twelve additional descriptors. These are regression bounds,
274+
not a general memory guarantee. Samples measure the engine process, not WebKit,
275+
model-server memory, or transient peaks between samples. Large repository maps,
276+
long individual conversations, desktop memory and longer-duration soaks remain
277+
separate release checks. `SHADOW_STRESS_BINARY` must point directly to the native
278+
ELF executable; an AppImage launcher is deliberately rejected for RSS attribution.
279+
254280
## Native terminal interface
255281

256282
The initial `shadowcode tui` frontend passes a real-PTY probe with **8 scripted

0 commit comments

Comments
 (0)