Repository navigation
perf(shell): wake sealed channel readers without polling - #944
Draft
Haoming9527 wants to merge 1 commit into
Draft
Haoming9527 wants to merge 1 commit into
Haoming9527 wants to merge 1 commit into
Conversation
This was referenced Nov 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #872 and #932. Stacked on #933; this is a measured performance slice, not full acceptance.
What was wrong
Each Windows session command sealed three private channels, but pending connects woke on a timer and drain polled reader completion. On this host the unchanged driver measured 46.33 ms p50 / 51.10 ms p95 for 300 empty commands.
The change
Signal pending connect operations with a manual-reset event and wait for physical reader-thread termination using owned thread handles. Active reads still drain to authenticated EOF, spill settlement stays checked, and cancellation joins overlapped I/O before releasing buffers.
Add normal-gate real resident-worker assertions for current-generation forged stdout receipts, surviving background jobs (including disowned redirected jobs), sibling preservation, and explicit rejection of unregistered stock asynchronous output. The Windows-only suite is an explicit platform skip on POSIX; missing Windows runtime remains a failure.
Include bilingual performance notes, the supplied harness with executable-path parameters, and both paired raw reports. No dependencies, runtime pins, public contracts, output caps, or model schemas changed.
Validation
cargo test --locked --manifest-path native/Cargo.toml -p ops-process: 43 passed, 0 failed, 5 ignored child fixtures.cargo clippy --locked --manifest-path native/Cargo.toml -p ops-process --all-targets -- -D warnings: passed.npm run build: passed.DSH_OPS_REQUIRE_RUNTIME=1 node test/run.mjs resident-shell-integrity: 3 checks passed, 1 suite, no skips.node scripts/check-file-size.mjs: 950 code files passed; longest 948 lines.git diff --check: passed.node scripts/verify-gate.mjs --skip-install: 741 Rust tests passed (8 ignored fixtures/platform cases), 264 JavaScript suites passed, 4 allowed skips, and 92 manifest checks passed. The command failed at package extraction because Windows bsdtar rejected non-ASCII filenames. Repeating that exact package extraction with installed GNU tar 1.35 succeeded; the subsequent packed-runtime closure check passed (1 runtime, SHA-2561bb7a20ba597c45b6d761df8bc7dbc12fc255dc866ff2f84556d012a65f0d15c). The original gate exit remains reported as failed; PR CI is the cross-platform reference.24ac360551c1336453b78268090574f97a1de50a, passed. All 10 jobs succeeded, including Windows/Linux/macOS functional gates and the aggregateCI requiredcheck.Paired empty-command results (p50 / p95): connect wake alone 46.48 / 48.77 → 16.05 / 17.22 ms; connect wake plus thread-handle wait 46.33 / 51.10 → 9.04 / 10.30 ms. Each run uses 300 samples, 30 warmups and the same stock executable. Full raw results include printf tails without filtering.
The ≤1 ms p50 / ≤3 ms p95 target is not met. The 106-operation scenario, cold startup, host orchestration, Linux comparison, channel pooling and redundant prompt/file work remain outstanding. The attached scenario summary disagrees with its raw report and needs reconciliation. These driver-only results do not establish full feature or end-to-end performance acceptance.
Environment
Windows x64, Ryzen 7 6800HS, Node 26.12.1, Rust 1.97.1 release binaries built in isolated target directories. Parent is #933 at
06c22a65, whose PR-triggered CI passed: https://github.com/T-Auto/dsh-ops/actions/runs/43554104077. This host differs from the maintainer's i9-13900H.See performance evidence for exact hashes and measurement limits.